MrPio commited on
Commit
5c4b8ff
·
verified ·
1 Parent(s): 3a82778

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 = np.round(torch.softmax(model(**inputs).logits, 1).squeeze().numpy(), 3)
19
- return {c: prediction[i] for c, i in CLASSES}
20
 
21
 
22
  demo = gr.Interface(
 
15
 
16
  def ask(question):
17
  inputs = tokenizer(story, question, truncation=True, padding=True)
18
+ prediction = torch.round(torch.softmax(model(**inputs).logits, 1).squeeze().numpy(), 3)
19
+ return {c: prediction[i].item() for c, i in CLASSES}
20
 
21
 
22
  demo = gr.Interface(