seonglae commited on
Commit
b750381
1 Parent(s): 76ce883

fix: change reader to dpr natural questions

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. model.py +1 -1
app.py CHANGED
@@ -15,7 +15,7 @@ INITIAL = "What is the population of NYC"
15
  st.set_page_config(page_title=TITLE)
16
  st.header(TITLE)
17
  st.markdown('''
18
- ### Ask short-answer question that can be find in Wikipedia data.
19
  ''', unsafe_allow_html=True)
20
 
21
 
@@ -54,7 +54,7 @@ styl = """
54
  st.markdown(styl, unsafe_allow_html=True)
55
 
56
 
57
- question = st.text_area("Text to summarize", INITIAL, height=400)
58
 
59
 
60
  @torch.inference_mode()
 
15
  st.set_page_config(page_title=TITLE)
16
  st.header(TITLE)
17
  st.markdown('''
18
+ <h6>Ask short-answer question that can be find in Wikipedia data.</h6>
19
  ''', unsafe_allow_html=True)
20
 
21
 
 
54
  st.markdown(styl, unsafe_allow_html=True)
55
 
56
 
57
+ question = st.text_area("Text to summarize", INITIAL)
58
 
59
 
60
  @torch.inference_mode()
model.py CHANGED
@@ -63,7 +63,7 @@ def ask_reader(tokenizer: AutoTokenizer, model: AutoModelForQuestionAnswering,
63
  return answer_infos
64
 
65
 
66
- def get_reader(model_id="mrm8488/longformer-base-4096-finetuned-squadv2"):
67
  tokenizer = DPRReaderTokenizer.from_pretrained(model_id)
68
  model = DPRReader.from_pretrained(model_id)
69
  if cuda:
 
63
  return answer_infos
64
 
65
 
66
+ def get_reader(model_id="facebook/dpr-reader-single-nq-base"):
67
  tokenizer = DPRReaderTokenizer.from_pretrained(model_id)
68
  model = DPRReader.from_pretrained(model_id)
69
  if cuda: