Spaces:
Runtime error
Runtime error
Commit
·
ff878ab
1
Parent(s):
071c26a
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,13 +8,14 @@ from huggingface_hub import model_info
|
|
| 8 |
MODEL_NAME = "openai/whisper-small"
|
| 9 |
|
| 10 |
device = 0 if torch.cuda.is_available() else "cpu"
|
|
|
|
| 11 |
|
| 12 |
-
pipe = ASRDiarizationPipeline(
|
| 13 |
asr_model=MODEL_NAME,
|
| 14 |
device=device,
|
|
|
|
| 15 |
)
|
| 16 |
|
| 17 |
-
|
| 18 |
def transcribe(microphone, file_upload):
|
| 19 |
warn_output = ""
|
| 20 |
if (microphone is not None) and (file_upload is not None):
|
|
|
|
| 8 |
MODEL_NAME = "openai/whisper-small"
|
| 9 |
|
| 10 |
device = 0 if torch.cuda.is_available() else "cpu"
|
| 11 |
+
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 12 |
|
| 13 |
+
pipe = ASRDiarizationPipeline.from_pretrained(
|
| 14 |
asr_model=MODEL_NAME,
|
| 15 |
device=device,
|
| 16 |
+
use_auth_token=HF_TOKEN,
|
| 17 |
)
|
| 18 |
|
|
|
|
| 19 |
def transcribe(microphone, file_upload):
|
| 20 |
warn_output = ""
|
| 21 |
if (microphone is not None) and (file_upload is not None):
|