Spaces:
Running
on
L4
Running
on
L4
Sofia Casadei
commited on
Commit
·
ce1a70a
1
Parent(s):
74081c9
up
Browse files
main.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import os
|
2 |
import logging
|
3 |
import uvicorn
|
|
|
4 |
|
5 |
import gradio as gr
|
6 |
import numpy as np
|
@@ -43,7 +44,7 @@ logger.info(f"CUDA Version: {cuda_version}, GPU Device: {device_name}")
|
|
43 |
attention = "flash_attention_2" if is_flash_attn_2_available() else "sdpa"
|
44 |
logger.info(f"Using attention: {attention}")
|
45 |
|
46 |
-
model_id = "openai/whisper-large-v3-turbo"
|
47 |
logger.info(f"Loading Whisper model: {model_id}")
|
48 |
model = AutoModelForSpeechSeq2Seq.from_pretrained(
|
49 |
model_id,
|
|
|
1 |
import os
|
2 |
import logging
|
3 |
import uvicorn
|
4 |
+
import json
|
5 |
|
6 |
import gradio as gr
|
7 |
import numpy as np
|
|
|
44 |
attention = "flash_attention_2" if is_flash_attn_2_available() else "sdpa"
|
45 |
logger.info(f"Using attention: {attention}")
|
46 |
|
47 |
+
model_id = os.getenv("MODEL_ID", "openai/whisper-large-v3-turbo")
|
48 |
logger.info(f"Loading Whisper model: {model_id}")
|
49 |
model = AutoModelForSpeechSeq2Seq.from_pretrained(
|
50 |
model_id,
|