QA_test / app.py
DineshDyne's picture
test script
913a435
raw
history blame
538 Bytes
import streamlit as st
from langchain.llms import HuggingFaceHub
def get_answer(question,model_name="google/flan-t5-large"):
model=HuggingFaceHub(repo_id=model_name)
return model(question)
st.set_page_config(
page_title="Simple Q&A App",
page_icon=":robot:"
)
st.header("Do It!!!! Ask the Question.....")
question=st.text_input("Question:")
submit=st.button("Submit")
if submit:
with st.spinner("In progress..."):
response=get_answer(question)
st.subheader("Response")
st.write(f"{response}")