Spaces:
Running
Running
Added HF_TOKEN
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import gradio
|
|
2 |
import logging
|
3 |
import time
|
4 |
from transformers import pipeline
|
|
|
5 |
|
6 |
logger = logging.getLogger("gradio_test_001")
|
7 |
logger.setLevel(logging.INFO)
|
@@ -13,11 +14,12 @@ categories = [
|
|
13 |
"Card Payments", "Banking", "Regulations", "Account Payments"
|
14 |
]
|
15 |
logging.debug("Categories to classify: " + repr(categories))
|
16 |
-
|
17 |
classifier = pipeline("zero-shot-classification",
|
18 |
# model="google-bert/bert-base-uncased")
|
19 |
-
model="Xylor/bert-case-uncased-single-sampled")
|
20 |
# model="facebook/bart-large-mnli")
|
|
|
|
|
21 |
|
22 |
# sequence_to_classify = "one day I will see the world"
|
23 |
# candidate_labels = ['travel', 'cooking', 'dancing']
|
|
|
2 |
import logging
|
3 |
import time
|
4 |
from transformers import pipeline
|
5 |
+
import os
|
6 |
|
7 |
logger = logging.getLogger("gradio_test_001")
|
8 |
logger.setLevel(logging.INFO)
|
|
|
14 |
"Card Payments", "Banking", "Regulations", "Account Payments"
|
15 |
]
|
16 |
logging.debug("Categories to classify: " + repr(categories))
|
17 |
+
HF_TOKEN = os.getenv("HF_TOKEN")
|
18 |
classifier = pipeline("zero-shot-classification",
|
19 |
# model="google-bert/bert-base-uncased")
|
|
|
20 |
# model="facebook/bart-large-mnli")
|
21 |
+
model="Xylor/bert-case-uncased-single-sampled",
|
22 |
+
token=HF_TOKEN)
|
23 |
|
24 |
# sequence_to_classify = "one day I will see the world"
|
25 |
# candidate_labels = ['travel', 'cooking', 'dancing']
|