Spaces:
Runtime error
Runtime error
add app.py
Browse files
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
qa_pipe = pipeline('question-answering')
|
5 |
+
context = st.text_area('provide context')
|
6 |
+
question = st.text_area('ask your question')
|
7 |
+
|
8 |
+
if text and context:
|
9 |
+
out = qa_pipe(dict(
|
10 |
+
question=question,
|
11 |
+
context=context
|
12 |
+
))
|
13 |
+
st.json(out)
|