harichselvamc commited on
Commit
edf0c9c
·
verified ·
1 Parent(s): b25f3a6

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -0
app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from langchain_community.llms import HuggingFaceHub
3
+ import os
4
+
5
+
6
+ def showresponse(answer):
7
+ llm = HuggingFaceHub(repo_id="google/flan-t5-large")
8
+ tested = str(answer)
9
+ response = llm(tested)
10
+ return response
11
+
12
+ st.title("Hello Welcome to Chatbot using the google model")
13
+
14
+ def get_text():
15
+ input_text = st.text_input("You:", "hello Thanks for your attention", key="input")
16
+ return input_text
17
+
18
+ user_input = get_text()
19
+
20
+ response = showresponse(user_input)
21
+
22
+ submit = st.button("Generate")
23
+
24
+ if submit:
25
+ st.subheader("Generated")
26
+ st.write(response)