Spaces:
Running
Running
Setup Gradio space
Browse files
app.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
-
from transformers import AutoModelForSequenceClassification,
|
4 |
|
5 |
CLASSES = {
|
6 |
'yes': 0,
|
7 |
'irrelevant': 1,
|
8 |
'no': 2,
|
9 |
}
|
10 |
-
tokenizer =
|
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()
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
+
from transformers import AutoModelForSequenceClassification, DebertaV2Tokenizer
|
4 |
|
5 |
CLASSES = {
|
6 |
'yes': 0,
|
7 |
'irrelevant': 1,
|
8 |
'no': 2,
|
9 |
}
|
10 |
+
tokenizer = DebertaV2Tokenizer.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()
|