nvinay1803 commited on
Commit
d050156
1 Parent(s): 6615ce0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -0
app.py CHANGED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ from langchain.llms import HuggingFaceHub
4
+
5
+ def load_answer(question):
6
+ llm = HuggingFaceHub(repo_id = "google/flan-t5-large")
7
+ ans = llm.invoke(question)
8
+ return ans
9
+
10
+ st.set_page_config(page_title="LangChain Demo", page_icon=":robot:")
11
+ st.header("LangChain Demo")
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 submit:
23
+ st.subheader('Answer:')
24
+ st.write(response)