Spaces:
Sleeping
Sleeping
Update tasks/text.py
Browse files- tasks/text.py +6 -1
tasks/text.py
CHANGED
@@ -65,7 +65,12 @@ async def evaluate_text(request: TextEvaluationRequest):
|
|
65 |
import onnxruntime as ort
|
66 |
|
67 |
# Load the ONNX model and tokenizer
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
69 |
tokenizer = DistilBertTokenizer.from_pretrained("distilbert-base-uncased")
|
70 |
ort_session = ort.InferenceSession(MODEL_PATH, providers=["CPUExecutionProvider"])
|
71 |
|
|
|
65 |
import onnxruntime as ort
|
66 |
|
67 |
# Load the ONNX model and tokenizer
|
68 |
+
from huggingface_hub import hf_hub_download
|
69 |
+
|
70 |
+
MODEL_REPO = "ClimateDebunk/Quantized_DistilBertForSequenceClassification"
|
71 |
+
MODEL_FILENAME = "distilbert_quantized_dynamic.onnx"
|
72 |
+
MODEL_PATH = hf_hub_download(repo_id=MODEL_REPO, filename=MODEL_FILENAME)
|
73 |
+
|
74 |
tokenizer = DistilBertTokenizer.from_pretrained("distilbert-base-uncased")
|
75 |
ort_session = ort.InferenceSession(MODEL_PATH, providers=["CPUExecutionProvider"])
|
76 |
|