Spaces:
Runtime error
Runtime error
Update app.py
Browse files4 unmodified lines56789101110 unmodified lines222324252627282930314 unmodified linessubprocess.run(["pip", "install", "datasets"])subprocess.run(["pip", "install", "transformers"])subprocess.run(["pip", "install", "torch", "torchvision", "torchaudio", "-f", "https://download.pytorch.org/whl/torch_stable.html"])import gradio as grfrom transformers import WhisperProcessor, WhisperForConditionalGeneration10 unmodified linesreturn processed_data# Function to perform ASR on audio datadef transcribe_audio(input_features):# Generate token idspredicted_ids = model.generate(**input_features)# Decode token ids to texttranscription = processor.batch_decode(predicted_ids, skip_special_tokens=True)4 unmodified lines567891010 unmodified lines212223242526272829303132334 unmodified linessubprocess.run(["pip", "install", "datasets"])subprocess.run(["pip", "install", "transformers"])subprocess.run(["pip", "install", "torch", "torchvision", "torchaudio", "-f", "https://download.pytorch.org/whl/torch_stable.html"])import gradio as grfrom transformers import WhisperProcessor, WhisperForConditionalGeneration10 unmodified linesreturn processed_data# Function to perform ASR on audio datadef transcribe_audio(audio_data):# Preprocess the audio datainput_features = preprocess_audio(audio_data)# Generate token idspredicted_ids = model.generate(input_features)# Decode token ids to texttranscription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
app.py+6-4