Spaces:
Runtime error
Runtime error
import streamlit as st | |
from transformers import pipeline | |
qa = pipeline("question-answering" , model="JBDef/finetuned_yelp") | |
def main(): | |
st.title("Question Answering") | |
with st.form("text_field"): | |
question = st.text_input("Enter some question :") | |
context = st.text_area("Enter some context :") | |
# clicked==True only when the button is clicked | |
clicked = st.form_submit_button("Submit") | |
if clicked: | |
results = qa(question , context) | |
st.json(results) | |
if __name__ == "__main__": | |
main() |