OOlajide commited on
Commit
23189bc
1 Parent(s): 25a1096

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- question_answerer = pipeline("question-answering")
 
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)