Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,25 +1,25 @@
|
|
1 |
-
# Q&A Chatbot
|
2 |
-
from langchain.llms import OpenAI
|
3 |
-
from dotenv import load_dotenv
|
4 |
-
import os
|
5 |
-
import streamlit as st
|
6 |
-
load_dotenv()
|
7 |
-
|
8 |
-
def get_openai_response(question):
|
9 |
-
llm = OpenAI(
|
10 |
-
response= llm(question)
|
11 |
-
return response
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
# streamlit code
|
16 |
-
st.set_page_config(page_title='Q&A Demo')
|
17 |
-
st.header("Langchain Application")
|
18 |
-
|
19 |
-
input= st.text_input("input :",key='input')
|
20 |
-
response = get_openai_response(input)
|
21 |
-
|
22 |
-
submit = st.button('Ask the Question')
|
23 |
-
if submit:
|
24 |
-
st.subheader("The Response is")
|
25 |
st.write(response)
|
|
|
1 |
+
# Q&A Chatbot
|
2 |
+
from langchain.llms import OpenAI
|
3 |
+
#from dotenv import load_dotenv
|
4 |
+
import os
|
5 |
+
import streamlit as st
|
6 |
+
#load_dotenv()
|
7 |
+
|
8 |
+
def get_openai_response(question):
|
9 |
+
llm = OpenAI(model_name='gpt-3.5-turbo-instruct',temperature=0.5)
|
10 |
+
response= llm(question)
|
11 |
+
return response
|
12 |
+
|
13 |
+
|
14 |
+
|
15 |
+
# streamlit code
|
16 |
+
st.set_page_config(page_title='Q&A Demo')
|
17 |
+
st.header("Langchain Application")
|
18 |
+
|
19 |
+
input= st.text_input("input :",key='input')
|
20 |
+
response = get_openai_response(input)
|
21 |
+
|
22 |
+
submit = st.button('Ask the Question')
|
23 |
+
if submit:
|
24 |
+
st.subheader("The Response is")
|
25 |
st.write(response)
|