Spaces:
Sleeping
Sleeping
manu
commited on
Commit
•
ac85d37
1
Parent(s):
a8684d5
first fix for seagull!
Browse files
app.py
CHANGED
@@ -1,6 +1,12 @@
|
|
1 |
import numpy as np
|
2 |
import gradio as gr
|
|
|
3 |
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
title = "The Seagull story"
|
6 |
description = """
|
@@ -58,11 +64,12 @@ def generate_tone(index,question):
|
|
58 |
""".replace("\n","")
|
59 |
|
60 |
]
|
61 |
-
|
|
|
62 |
|
63 |
passages=["General","Pier","Boat","Island"]
|
64 |
|
65 |
-
gr.
|
66 |
"huggingface/MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli",
|
67 |
generate_tone,
|
68 |
[
|
|
|
1 |
import numpy as np
|
2 |
import gradio as gr
|
3 |
+
from transformers import TFAutoModelForSequenceClassification, AutoTokenizer
|
4 |
|
5 |
+
checkpoint="MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli"
|
6 |
+
|
7 |
+
|
8 |
+
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
9 |
+
model=TFAutoModelForSequenceClassification.from_pretrained(checkpoint,from_pt=True)
|
10 |
|
11 |
title = "The Seagull story"
|
12 |
description = """
|
|
|
64 |
""".replace("\n","")
|
65 |
|
66 |
]
|
67 |
+
inputs=tokenizer(passages[index],question, return_tensors="tf")
|
68 |
+
return (model(**inputs).logits)
|
69 |
|
70 |
passages=["General","Pier","Boat","Island"]
|
71 |
|
72 |
+
gr.load(
|
73 |
"huggingface/MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli",
|
74 |
generate_tone,
|
75 |
[
|