avinashmhto commited on
Commit
c1b6da1
·
1 Parent(s): 53f98f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -0
app.py CHANGED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ from langchain.llms import HuggingFaceHub
4
+
5
+ def load_answer(question):
6
+ llm = HuggingFace(model_name="google/flan-t5-large",temperature=0)
7
+ answer=llm(question)
8
+ return answer
9
+
10
+ st.set_page_config(page_title="Gloria-GPT", page_icon=":robot:")
11
+ st.header("Hi, I am Gloria-GPT, How may I assist you ?")
12
+
13
+ def get_text():
14
+ input_text = st.text_input("You: ", key="input")
15
+ return input_text
16
+
17
+ user_input=get_text()
18
+ response = load_answer(user_input)
19
+
20
+ submit = st.button('Generate')
21
+
22
+ #If generate button is clicked
23
+ if submit:
24
+
25
+ st.subheader("Answer:")
26
+
27
+ st.write(response)