spellingdragon
commited on
Commit
•
e9204c7
1
Parent(s):
e8d6e13
Update handler.py
Browse files- handler.py +4 -4
handler.py
CHANGED
@@ -9,10 +9,10 @@ class EndpointHandler():
|
|
9 |
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
|
10 |
model_id = "openai/whisper-large-v3"
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
|
17 |
processor = AutoProcessor.from_pretrained(model_id)
|
18 |
#processor = WhisperProcessor.from_pretrained(model_id)
|
|
|
9 |
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
|
10 |
model_id = "openai/whisper-large-v3"
|
11 |
|
12 |
+
model = AutoModelForSpeechSeq2Seq.from_pretrained(
|
13 |
+
model_id, torch_dtype=torch_dtype, low_cpu_mem_usage=True, use_safetensors=True
|
14 |
+
)
|
15 |
+
model.to(device)
|
16 |
|
17 |
processor = AutoProcessor.from_pretrained(model_id)
|
18 |
#processor = WhisperProcessor.from_pretrained(model_id)
|