harichselvamc's picture
Upload app.py
edf0c9c verified
raw
history blame contribute delete
588 Bytes
import streamlit as st
from langchain_community.llms import HuggingFaceHub
import os
def showresponse(answer):
llm = HuggingFaceHub(repo_id="google/flan-t5-large")
tested = str(answer)
response = llm(tested)
return response
st.title("Hello Welcome to Chatbot using the google model")
def get_text():
input_text = st.text_input("You:", "hello Thanks for your attention", key="input")
return input_text
user_input = get_text()
response = showresponse(user_input)
submit = st.button("Generate")
if submit:
st.subheader("Generated")
st.write(response)