YUNSUN7 commited on
Commit
c573e4c
·
verified ·
1 Parent(s): d65e6aa

Create Gpu

Browse files
Files changed (1) hide show
  1. Gpu +7 -0
Gpu ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ from optimum.pipelines import pipeline
2
+ from transformers import AutoTokenizer
3
+
4
+ tokenizer = AutoTokenizer.from_pretrained("distilbert/distilbert-base-uncased-finetuned-sst-2-english")
5
+
6
+ pipeline = pipeline(task="text-classification", model=ort_model, tokenizer=tokenizer, device="cuda:0")
7
+ result = pipeline("Both the music and visual were astounding, not to mention the actors performance.")