vrushabh94
commited on
Commit
•
a9beb0c
1
Parent(s):
0251703
Removed the sharing
Browse files- app.py +0 -3
- requirements.txt +1 -0
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
|
2 |
import gradio as gr
|
3 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
4 |
import torch
|
@@ -12,8 +11,6 @@ premise = ""
|
|
12 |
hypothesis = ""
|
13 |
|
14 |
def zeroShotClassification(text_input, candidate_labels, hypothesis):
|
15 |
-
print(text_input)
|
16 |
-
print(candidate_labels)
|
17 |
input = tokenizer(text_input, hypothesis, truncation=True, return_tensors="pt")
|
18 |
output = model(input["input_ids"].to(device)) # device = "cuda:0" or "cpu"
|
19 |
prediction = torch.softmax(output["logits"][0], -1).tolist()
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
3 |
import torch
|
|
|
11 |
hypothesis = ""
|
12 |
|
13 |
def zeroShotClassification(text_input, candidate_labels, hypothesis):
|
|
|
|
|
14 |
input = tokenizer(text_input, hypothesis, truncation=True, return_tensors="pt")
|
15 |
output = model(input["input_ids"].to(device)) # device = "cuda:0" or "cpu"
|
16 |
prediction = torch.softmax(output["logits"][0], -1).tolist()
|
requirements.txt
CHANGED
@@ -2,3 +2,4 @@
|
|
2 |
gradio
|
3 |
transformers
|
4 |
torch
|
|
|
|
2 |
gradio
|
3 |
transformers
|
4 |
torch
|
5 |
+
sentencepiece
|