Update app.py
Browse files
app.py
CHANGED
@@ -42,8 +42,7 @@ end_idx = torch.argmax(end_logits) + 1
|
|
42 |
answer_span = inputs["input_ids"][0][start_idx:end_idx]
|
43 |
answer = tokenizer.decode(answer_span)
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
#st.write('Please ask a longer question about the Amazon')
|
|
|
42 |
answer_span = inputs["input_ids"][0][start_idx:end_idx]
|
43 |
answer = tokenizer.decode(answer_span)
|
44 |
|
45 |
+
try:
|
46 |
+
st.write(f"Answer: {answer}")
|
47 |
+
except:
|
48 |
+
st.write('Please ask a longer question about the Amazon')
|
|