Spaces:
Runtime error
Runtime error
Commit
•
2ad1599
1
Parent(s):
f9b9b93
fix optimum
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ import time
|
|
7 |
import os
|
8 |
|
9 |
BATCH_SIZE = 16
|
|
|
10 |
TOKEN = os.environ.get("HF_TOKEN", None)
|
11 |
|
12 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
@@ -21,8 +22,8 @@ distilled_model = AutoModelForSpeechSeq2Seq.from_pretrained(
|
|
21 |
)
|
22 |
|
23 |
if not use_flash_attention_2:
|
24 |
-
model = model.
|
25 |
-
distilled_model = distilled_model.
|
26 |
|
27 |
processor = AutoProcessor.from_pretrained("openai/whisper-tiny.en")
|
28 |
|
|
|
7 |
import os
|
8 |
|
9 |
BATCH_SIZE = 16
|
10 |
+
# TODO: remove token before release
|
11 |
TOKEN = os.environ.get("HF_TOKEN", None)
|
12 |
|
13 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
|
|
22 |
)
|
23 |
|
24 |
if not use_flash_attention_2:
|
25 |
+
model = model.to_bettertransformer()
|
26 |
+
distilled_model = distilled_model.to_bettertransformer()
|
27 |
|
28 |
processor = AutoProcessor.from_pretrained("openai/whisper-tiny.en")
|
29 |
|