File size: 743 Bytes
68df196
913a435
68df196
 
913a435
51ce215
68df196
 
 
 
 
 
 
 
 
913a435
68df196
9ecaf13
68df196
b9185c9
 
68df196
 
 
 
 
66d523b
51ce215
913a435
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
28
29
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.....")

col1,col2=st.columns([5,3])

question=col1.text_area("Question:")
model_name=col2.selectbox("Model Name",options=["google/flan-t5-large","deepset/roberta-base-squad2","AmazonScience/qanlu","gpt2-medium","EleutherAI/gpt-neo-125m"])

submit=st.button("Submit")

if submit:
    with st.spinner("In progress..."):
        response=get_answer(question,model_name)
    st.subheader("Response")
    st.write(f"{response}")