Spaces:
Running
on
Zero
Running
on
Zero
Lord-Raven
commited on
Commit
·
ad14b41
1
Parent(s):
a3801b6
Trying ONNX models on CPU.
Browse files
app.py
CHANGED
@@ -28,8 +28,8 @@ print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
|
|
28 |
# tokenizer_name = "MoritzLaurer/deberta-v3-base-zeroshot-v2.0"
|
29 |
model_name = "MoritzLaurer/ModernBERT-large-zeroshot-v2.0"
|
30 |
|
31 |
-
classifier_cpu = pipeline(task="zero-shot-classification", model=model_name)
|
32 |
-
classifier_gpu = pipeline(task="zero-shot-classification", model=model_name, device="cuda:0")
|
33 |
|
34 |
def classify(data_string, request: gradio.Request):
|
35 |
if request:
|
|
|
28 |
# tokenizer_name = "MoritzLaurer/deberta-v3-base-zeroshot-v2.0"
|
29 |
model_name = "MoritzLaurer/ModernBERT-large-zeroshot-v2.0"
|
30 |
|
31 |
+
classifier_cpu = pipeline(task="zero-shot-classification", model=model_name, provider="CPUExecutionProvider")
|
32 |
+
classifier_gpu = pipeline(task="zero-shot-classification", model=model_name, provider="CUDAExecutionProvider", device="cuda:0")
|
33 |
|
34 |
def classify(data_string, request: gradio.Request):
|
35 |
if request:
|