MrPio commited on
Commit
82143cc
·
verified ·
1 Parent(s): 53504b1

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 = torch.softmax(model(**inputs), dim=-1).squeeze()
19
- return [{c: prediction[i].item() 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.softmax(model(**inputs).logits, dim=-1).squeeze()
19
+ return {c: prediction[i].item() for c, i in CLASSES}
20
 
21
 
22
  demo = gr.Interface(