Spaces:
Running
Running
fix: change reader to dpr natural questions
Browse files
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 |
-
|
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
|
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="
|
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:
|