Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import streamlit as st
|
2 |
-
from transformers import pipeline
|
3 |
|
4 |
st.set_page_config(page_title="Common NLP Tasks")
|
5 |
st.title("Common NLP Tasks")
|
@@ -13,7 +13,8 @@ option = st.sidebar.radio('', ['Extractive question answering', 'Text summarizat
|
|
13 |
|
14 |
@st.cache(show_spinner=False, allow_output_mutation=True)
|
15 |
def question_model():
|
16 |
-
|
|
|
17 |
return question_answerer
|
18 |
|
19 |
@st.cache(show_spinner=False, allow_output_mutation=True)
|
|
|
1 |
import streamlit as st
|
2 |
+
from transformers import pipeline, AutoTokenizer, AutoModelForQuestionAnswering
|
3 |
|
4 |
st.set_page_config(page_title="Common NLP Tasks")
|
5 |
st.title("Common NLP Tasks")
|
|
|
13 |
|
14 |
@st.cache(show_spinner=False, allow_output_mutation=True)
|
15 |
def question_model():
|
16 |
+
tokenizer = AutoTokenizer.from_pretrained("deepset/roberta-base-squad2")
|
17 |
+
model = AutoModelForQuestionAnswering.from_pretrained("deepset/roberta-base-squad2")
|
18 |
return question_answerer
|
19 |
|
20 |
@st.cache(show_spinner=False, allow_output_mutation=True)
|