Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,10 +60,7 @@ def generate(image, video, audio, instruction=DEFAULT_INPUT, sampling=False, tem
|
|
| 60 |
vid = encode_video(video)
|
| 61 |
inputs = [{"role": "user", "content": vid + [instruction]}]
|
| 62 |
elif audio is not None:
|
| 63 |
-
|
| 64 |
-
aud, _ = librosa.load(audio, sr=16000, mono=True)
|
| 65 |
-
else:
|
| 66 |
-
aud = audio
|
| 67 |
inputs = [{"role": "user", "content": [aud, instruction]}]
|
| 68 |
else:
|
| 69 |
return "No input provided."
|
|
@@ -94,7 +91,7 @@ with gr.Blocks(css=css) as main:
|
|
| 94 |
with gr.Column():
|
| 95 |
input = gr.Image(label="Image")
|
| 96 |
input_2 = gr.Video(label="Video")
|
| 97 |
-
input_3 = gr.Audio(label="Audio")
|
| 98 |
instruction = gr.Textbox(lines=1, value=DEFAULT_INPUT, label="Instruction")
|
| 99 |
sampling = gr.Checkbox(value=False, label="Sampling")
|
| 100 |
temperature = gr.Slider(minimum=0.01, maximum=1.99, step=0.01, value=0.7, label="Temperature")
|
|
|
|
| 60 |
vid = encode_video(video)
|
| 61 |
inputs = [{"role": "user", "content": vid + [instruction]}]
|
| 62 |
elif audio is not None:
|
| 63 |
+
aud, _ = librosa.load(audio, sr=16000, mono=True)
|
|
|
|
|
|
|
|
|
|
| 64 |
inputs = [{"role": "user", "content": [aud, instruction]}]
|
| 65 |
else:
|
| 66 |
return "No input provided."
|
|
|
|
| 91 |
with gr.Column():
|
| 92 |
input = gr.Image(label="Image")
|
| 93 |
input_2 = gr.Video(label="Video")
|
| 94 |
+
input_3 = gr.Audio(label="Audio", type="filepath")
|
| 95 |
instruction = gr.Textbox(lines=1, value=DEFAULT_INPUT, label="Instruction")
|
| 96 |
sampling = gr.Checkbox(value=False, label="Sampling")
|
| 97 |
temperature = gr.Slider(minimum=0.01, maximum=1.99, step=0.01, value=0.7, label="Temperature")
|