Spaces:
Runtime error
Runtime error
changed requirements
Browse files- app.py +0 -1
- requirements.txt +4 -7
- test.py +9 -28
app.py
CHANGED
|
@@ -12,7 +12,6 @@ from scipy.io.wavfile import write
|
|
| 12 |
import PIL
|
| 13 |
from openai import OpenAI
|
| 14 |
dotenv.load_dotenv()
|
| 15 |
-
import time
|
| 16 |
|
| 17 |
seamless_client = Client("facebook/seamless_m4t")
|
| 18 |
|
|
|
|
| 12 |
import PIL
|
| 13 |
from openai import OpenAI
|
| 14 |
dotenv.load_dotenv()
|
|
|
|
| 15 |
|
| 16 |
seamless_client = Client("facebook/seamless_m4t")
|
| 17 |
|
requirements.txt
CHANGED
|
@@ -1,9 +1,6 @@
|
|
| 1 |
-
python-decouple
|
| 2 |
-
gradio==4.1.2
|
| 3 |
-
git+https://github.com/huggingface/transformers
|
| 4 |
-
torchaudio==2.0.2
|
| 5 |
-
sentencepiece
|
| 6 |
python-dotenv
|
| 7 |
-
Pillow
|
| 8 |
scipy
|
| 9 |
-
openai
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
python-dotenv
|
| 2 |
+
Pillow==10.0.1
|
| 3 |
scipy
|
| 4 |
+
openai==1.1.2
|
| 5 |
+
gradio==4.1.2
|
| 6 |
+
gradio_client==0.7.0
|
test.py
CHANGED
|
@@ -1,35 +1,16 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
|
| 4 |
-
def
|
| 5 |
-
return
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
def process_audio(audio):
|
| 12 |
-
return "audio processed successfully"
|
| 13 |
|
| 14 |
-
|
| 15 |
-
with gr.Blocks() as iface:
|
| 16 |
-
gr.Markdown("# this is my demo for tab feature")
|
| 17 |
-
with gr.Tab("process Text"):
|
| 18 |
-
text_input = gr.Textbox()
|
| 19 |
-
text_output = gr.Textbox()
|
| 20 |
-
text_button = gr.Button("process text")
|
| 21 |
-
with gr.Tab("process Image"):
|
| 22 |
-
image_input = gr.Image()
|
| 23 |
-
image_output = gr.Textbox()
|
| 24 |
-
image_button = gr.Button("process image")
|
| 25 |
-
with gr.Tab("process Audio"):
|
| 26 |
-
audio_input = gr.Audio()
|
| 27 |
-
audio_output = gr.Textbox()
|
| 28 |
-
audio_button = gr.Button("process audio")
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
text_button.click(process_text, inputs=text_input, outputs=text_output)
|
| 32 |
-
image_button.click(process_image, inputs=image_input, outputs=image_output)
|
| 33 |
-
audio_button.click(process_audio, inputs=audio_input, outputs=audio_output)
|
| 34 |
-
|
| 35 |
-
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
|
| 4 |
+
def process_speech(audio):
|
| 5 |
+
return f"""audio {audio}
|
| 6 |
+
type {type(audio)}"""
|
| 7 |
|
| 8 |
|
| 9 |
+
with gr.Blocks(theme='ParityError/Anime') as iface :
|
| 10 |
+
audio_input = gr.Audio(label="talk in french")
|
| 11 |
+
audio_output = gr.Markdown(label="output text")
|
| 12 |
+
audio_button = gr.Button("process audio")
|
| 13 |
+
audio_button.click(process_speech, inputs=audio_input, outputs=audio_output)
|
| 14 |
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
iface.launch(show_error=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|