Spaces:
Running
on
Zero
Running
on
Zero
Update
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
|
|
2 |
from transformers import AutoModelForCausalLM, AutoProcessor, TextIteratorStreamer
|
3 |
import librosa
|
4 |
from threading import Thread
|
|
|
5 |
|
6 |
def split_audio(audio_arrays, chunk_limit=480000):
|
7 |
CHUNK_LIM = chunk_limit
|
@@ -24,7 +25,7 @@ def user(audio, text, chat_history):
|
|
24 |
return "", chat_history
|
25 |
|
26 |
|
27 |
-
|
28 |
def process_audio(audio, text, chat_history):
|
29 |
conversation = [
|
30 |
{
|
@@ -118,7 +119,6 @@ with gr.Blocks() as demo:
|
|
118 |
[
|
119 |
["Please transcribe the audio for me", "./examples/elon_musk.mp3"],
|
120 |
["Please transcribe the audio for me", "./examples/nvidia_conference.mp3"],
|
121 |
-
["Please transcribe the audio for me", "./examples/nuggets.mp3"],
|
122 |
["Please follow the instruction in the audio", "./examples/audio_instruction.wav"],
|
123 |
["What is the primary instrument featured in the solo of this track?", "./examples/music_under.wav"],
|
124 |
["What weather condition can be heard in the audio?", "./examples/audio_understand.wav"],
|
|
|
2 |
from transformers import AutoModelForCausalLM, AutoProcessor, TextIteratorStreamer
|
3 |
import librosa
|
4 |
from threading import Thread
|
5 |
+
import spaces
|
6 |
|
7 |
def split_audio(audio_arrays, chunk_limit=480000):
|
8 |
CHUNK_LIM = chunk_limit
|
|
|
25 |
return "", chat_history
|
26 |
|
27 |
|
28 |
+
@spaces.GPU
|
29 |
def process_audio(audio, text, chat_history):
|
30 |
conversation = [
|
31 |
{
|
|
|
119 |
[
|
120 |
["Please transcribe the audio for me", "./examples/elon_musk.mp3"],
|
121 |
["Please transcribe the audio for me", "./examples/nvidia_conference.mp3"],
|
|
|
122 |
["Please follow the instruction in the audio", "./examples/audio_instruction.wav"],
|
123 |
["What is the primary instrument featured in the solo of this track?", "./examples/music_under.wav"],
|
124 |
["What weather condition can be heard in the audio?", "./examples/audio_understand.wav"],
|