File size: 538 Bytes
68df196
 
 
 
51ce215
 
68df196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51ce215
 
68df196
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import streamlit as st
from langchain import HuggingFaceHub


def get_answer(question,model_name="google/flan-t5-small"):
    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.text_area(f"{response}")