Lord-Raven commited on
Commit
442d668
·
1 Parent(s): 1f33968

Messing with configuration.

Browse files
Files changed (1) hide show
  1. app.py +14 -5
app.py CHANGED
@@ -32,11 +32,20 @@ print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
32
  # "Xenova/distilbert-base-uncased-mnli" "typeform/distilbert-base-uncased-mnli" Bad answers
33
  # "Xenova/deBERTa-v3-base-mnli" "MoritzLaurer/DeBERTa-v3-base-mnli" Still a bit slow and not great answers
34
  # "xenova/nli-deberta-v3-small" "cross-encoder/nli-deberta-v3-small" Was using this for a good while and it was...okay
35
- model_name = "MoritzLaurer/deberta-v3-base-zeroshot-v2.0"
36
- file_name = "onnx/model.onnx"
37
- tokenizer_name = "MoritzLaurer/deberta-v3-base-zeroshot-v2.0"
38
- model = ORTModelForSequenceClassification.from_pretrained(model_name, file_name=file_name, provider="CUDAExecutionProvider")
39
- tokenizer = AutoTokenizer.from_pretrained(tokenizer_name, model_max_length=512)
 
 
 
 
 
 
 
 
 
40
  classifier = pipeline(task="zero-shot-classification", model=model, tokenizer=tokenizer, device="cuda:0")
41
 
42
  def classify(data_string, request: gradio.Request):
 
32
  # "Xenova/distilbert-base-uncased-mnli" "typeform/distilbert-base-uncased-mnli" Bad answers
33
  # "Xenova/deBERTa-v3-base-mnli" "MoritzLaurer/DeBERTa-v3-base-mnli" Still a bit slow and not great answers
34
  # "xenova/nli-deberta-v3-small" "cross-encoder/nli-deberta-v3-small" Was using this for a good while and it was...okay
35
+ # model_name = "MoritzLaurer/deberta-v3-base-zeroshot-v2.0"
36
+ # file_name = "onnx/model.onnx"
37
+ # tokenizer_name = "MoritzLaurer/deberta-v3-base-zeroshot-v2.0"
38
+ # model = ORTModelForSequenceClassification.from_pretrained(model_name, file_name=file_name, provider="CUDAExecutionProvider")
39
+ # tokenizer = AutoTokenizer.from_pretrained(tokenizer_name, model_max_length=512)
40
+
41
+ model = ORTModelForSequenceClassification.from_pretrained(
42
+ "philschmid/tiny-bert-sst2-distilled",
43
+ export=True,
44
+ provider="CUDAExecutionProvider",
45
+ )
46
+
47
+ tokenizer = AutoTokenizer.from_pretrained("philschmid/tiny-bert-sst2-distilled")
48
+
49
  classifier = pipeline(task="zero-shot-classification", model=model, tokenizer=tokenizer, device="cuda:0")
50
 
51
  def classify(data_string, request: gradio.Request):