Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,8 +15,8 @@ story = open('story.txt').read().replace("\n\n", "\n").replace("\n", " ").strip(
|
|
| 15 |
|
| 16 |
def ask(question):
|
| 17 |
inputs = tokenizer(story, question, truncation=True, padding=True)
|
| 18 |
-
prediction = torch.softmax(model(**inputs), dim=-1).squeeze()
|
| 19 |
-
return
|
| 20 |
|
| 21 |
|
| 22 |
demo = gr.Interface(
|
|
|
|
| 15 |
|
| 16 |
def ask(question):
|
| 17 |
inputs = tokenizer(story, question, truncation=True, padding=True)
|
| 18 |
+
prediction = torch.softmax(model(**inputs).logits, dim=-1).squeeze()
|
| 19 |
+
return {c: prediction[i].item() for c, i in CLASSES}
|
| 20 |
|
| 21 |
|
| 22 |
demo = gr.Interface(
|