MrPio commited on
Commit
45172d4
·
1 Parent(s): 8b8a073

Setup Gradio space

Browse files
Files changed (2) hide show
  1. app.py +6 -3
  2. requirements.txt +1 -0
app.py CHANGED
@@ -7,9 +7,9 @@ CLASSES = {
7
  'irrelevant': 1,
8
  'no': 2,
9
  }
 
10
  model = AutoModelForSequenceClassification.from_pretrained('MrPio/TheSeagullStory-nli-deberta-v3-base')
11
  model.eval()
12
- tokenizer = AutoTokenizer.from_pretrained('cross-encoder/nli-deberta-v3-base')
13
  story = open('story.txt').read().replace("\n\n", "\n").replace("\n", " ").strip()
14
 
15
 
@@ -24,8 +24,11 @@ demo = gr.Interface(
24
  inputs=[gr.Textbox(value="", label="Your question, as an affirmative sentence:")],
25
  outputs=[gr.Label(label="Answer", num_top_classes=3)],
26
  title="The Seagull Story",
27
- description="“ Albert and Dave find themselves on the pier. They go to a nearby restaurant where Albert orders seagull meat. The waiter promptly serves Albert the meal. After taking a bite, he realizes something. Albert pulls a gun out of his ruined jacket and shoots himself. ”\n\nWhy did Albert shoot himself?\n\nCan you unravel the truth behind this epilogue by asking only yes/no questions?",
28
- article='Please refrain from embarrassing DeBERTa with ridiculous questions.',
 
 
 
29
  examples=['Albert shoot himself for a reason',
30
  'Dave has a watch on his wrist',
31
  'Albert and Dave came to the pier on their own']
 
7
  'irrelevant': 1,
8
  'no': 2,
9
  }
10
+ tokenizer = AutoTokenizer.from_pretrained('cross-encoder/nli-deberta-v3-base',do_lower_case=True)
11
  model = AutoModelForSequenceClassification.from_pretrained('MrPio/TheSeagullStory-nli-deberta-v3-base')
12
  model.eval()
 
13
  story = open('story.txt').read().replace("\n\n", "\n").replace("\n", " ").strip()
14
 
15
 
 
24
  inputs=[gr.Textbox(value="", label="Your question, as an affirmative sentence:")],
25
  outputs=[gr.Label(label="Answer", num_top_classes=3)],
26
  title="The Seagull Story",
27
+ description="“ Albert and Dave find themselves on the pier. They go to a nearby restaurant where Albert orders "
28
+ "seagull meat. The waiter promptly serves Albert the meal. After taking a bite, he realizes "
29
+ "something. Albert pulls a gun out of his ruined jacket and shoots himself. ”\n\nWhy did Albert shoot "
30
+ "himself?\n\nCan you unravel the truth behind this epilogue by asking only yes/no questions?",
31
+ article='Please refrain from embarrassing DeBERTa with dumb questions.\n\nCheck the repository for more detail: https://github.com/MrPio/The-Seagull-Story',
32
  examples=['Albert shoot himself for a reason',
33
  'Dave has a watch on his wrist',
34
  'Albert and Dave came to the pier on their own']
requirements.txt CHANGED
@@ -1,4 +1,5 @@
1
  huggingface_hub==0.25.2
2
  transformers
 
3
  torch
4
  gradio
 
1
  huggingface_hub==0.25.2
2
  transformers
3
+ tokenizers
4
  torch
5
  gradio