Spaces:
Runtime error
Runtime error
import streamlit as st | |
from langchain import HuggingFaceHub | |
def get_answer(question,model): | |
return model(question) | |
def get_model(): | |
model=HuggingFaceHub("google/flan-t5-small") | |
return model | |
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:") | |
model=get_model() | |
submit=st.button("Submit") | |
if submit: | |
with st.spinner("In progress..."): | |
response=model(question) | |
st.text_area(f"{response}") |