Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| import nemo.collections.asr as nemo_asr | |
| import torch | |
| print("Starting Parakeet ASR App...") | |
| # Use GPU if available | |
| device = "cuda" if torch.cuda.is_available() else "cpu" | |
| print(f"Using device: {device}") | |
| print("Downloading Parakeet model from Hugging Face...") | |
| model = nemo_asr.models.ASRModel.from_pretrained( | |
| model_name="nvidia/parakeet-tdt-0.6b-v3" | |
| ) | |
| model = model.to(device) | |
| model.eval() | |
| print("Model loaded successfully!") | |
| def transcribe(audio): | |
| if audio is None: | |
| return "Please upload an audio file." | |
| try: | |
| result = model.transcribe(paths2audio_files=[audio]) | |
| return result[0] | |
| except Exception as e: | |
| return f"Error during transcription: {str(e)}" | |
| demo = gr.Interface( | |
| fn=transcribe, | |
| inputs=gr.Audio(type="filepath"), | |
| outputs="text", | |
| title="🎙️ Parakeet ASR (0.6B v3)", | |
| description="Speech-to-Text using NVIDIA Parakeet model (downloaded at runtime)" | |
| ) | |
| demo.launch(server_name="0.0.0.0", server_port=7860) |