babelAI commited on
Commit
e285f21
·
verified ·
1 Parent(s): d6fddc6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -0
app.py CHANGED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hello! It seems like you want to import the Streamlit library in Python. Streamlit is a powerful open-source framework used for building web applications with interactive data visualizations and machine learning models. To import Streamlit, you'll need to ensure that you have it installed in your Python environment.
2
+ # Once you have Streamlit installed, you can import it into your Python script using the import statement,
3
+
4
+ import streamlit as staticmethod
5
+
6
+
7
+ from langchain.llms import OpenAI
8
+
9
+ #Function to return the response
10
+ def load_answer(question):
11
+ llm = OpenAI(model_name="text-davinci-003", temperature=0)
12
+ answer=llm(question)
13
+ return answer
14
+
15
+ #App UI starts here
16
+ st.set_page_config(page_title="DataStream's Intelligent QA System", page_icon=":robot:")
17
+ st.header("DataStream's Intelligent QA System")
18
+
19
+ #Gets the user input
20
+ def get_text():
21
+ input_text = st.text_input("You: ", key="input")
22
+ return input_text
23
+
24
+ user_input=get_text()
25
+ response = load_answer(user_input)
26
+
27
+ submit = st.button('Generate')
28
+
29
+ #If generate button is clicked
30
+ if submit:
31
+
32
+ st.subheader("Answer:")
33
+ st.write(response)