Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,12 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
from transformers import pipeline, WhisperProcessor, WhisperForConditionalGeneration, AutoModelForSeq2SeqLM, AutoTokenizer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
# Initialize the Whisper processor and model
|
| 6 |
whisper_processor = WhisperProcessor.from_pretrained("openai/whisper-base")
|
|
@@ -46,4 +52,3 @@ iface = gr.Interface(
|
|
| 46 |
|
| 47 |
# Launch the app
|
| 48 |
iface.launch()
|
| 49 |
-
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
from transformers import pipeline, WhisperProcessor, WhisperForConditionalGeneration, AutoModelForSeq2SeqLM, AutoTokenizer
|
| 4 |
+
from huggingface_hub import login
|
| 5 |
+
import os
|
| 6 |
+
|
| 7 |
+
# Authenticate with Hugging Face
|
| 8 |
+
hf_api_token = os.getenv("HF_API_TOKEN")
|
| 9 |
+
login(token=hf_api_token)
|
| 10 |
|
| 11 |
# Initialize the Whisper processor and model
|
| 12 |
whisper_processor = WhisperProcessor.from_pretrained("openai/whisper-base")
|
|
|
|
| 52 |
|
| 53 |
# Launch the app
|
| 54 |
iface.launch()
|
|
|