DanielIglesias97 commited on
Commit
f869e1d
·
1 Parent(s): 9483aa1

First upload to the repo.

Browse files
Files changed (3) hide show
  1. Dockerfile +21 -0
  2. requirements.txt +2 -0
  3. webui.py +18 -0
Dockerfile ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12 AS base
2
+
3
+ RUN apt-get update
4
+ RUN apt-get install -y portaudio19-dev
5
+
6
+ RUN useradd -m -u 1000 user
7
+ USER user
8
+ ENV HOME=/home/user \
9
+ PATH=/home/user/.local/bin:$PATH
10
+
11
+ WORKDIR $HOME/app
12
+
13
+ COPY --chown=user ./requirements.txt ./requirements.txt
14
+
15
+ RUN pip3 install -r requirements.txt
16
+
17
+ COPY --chown=user . $HOME/app
18
+
19
+ FROM base AS run
20
+
21
+ CMD ["python", "webui.py"]
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ gradio==5.23.3
2
+ mlx-audio==0.0.3
webui.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+
4
+ def speech_to_text(input_text):
5
+ os.system(f"python -m mlx_audio.tts.generate --model mlx-community/csm-1b --text \"{input_text}\"")
6
+
7
+ return 'audio_000.wav'
8
+
9
+ demo = gr.Interface(
10
+ speech_to_text,
11
+ [
12
+ gr.Textbox(label="Text prompt"),
13
+ ],
14
+ [
15
+ gr.Audio(type="filepath"),
16
+ ]
17
+ )
18
+ demo.launch(server_name="0.0.0.0", server_port=7860)