Spaces:
No application file
No application file
Update APP.PY
Browse files
APP.PY
CHANGED
|
@@ -1,59 +1,35 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
|
| 4 |
-
def placeholder_generate(text, acting_prompt):
|
| 5 |
if not text.strip():
|
| 6 |
-
return "
|
| 7 |
-
|
| 8 |
-
return (
|
| 9 |
-
"✅ UI Skeleton is working.\n\n"
|
| 10 |
-
f"Text length: {len(text)} characters\n"
|
| 11 |
-
f"Acting prompt received: {bool(acting_prompt.strip())}\n\n"
|
| 12 |
-
"Next step: connect audio engine."
|
| 13 |
-
)
|
| 14 |
|
|
|
|
| 15 |
|
| 16 |
-
with gr.Blocks(
|
| 17 |
-
gr.Markdown(
|
| 18 |
-
"""
|
| 19 |
-
## 🎙️ FardaVoice
|
| 20 |
-
**Acting-based Text-to-Speech (Experimental)**
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
"""
|
| 27 |
)
|
| 28 |
|
| 29 |
text_input = gr.Textbox(
|
| 30 |
-
label="Text to
|
| 31 |
-
placeholder="
|
| 32 |
lines=6
|
| 33 |
)
|
| 34 |
|
| 35 |
-
|
| 36 |
-
label="Acting Prompt",
|
| 37 |
-
placeholder=(
|
| 38 |
-
"مثال:\n"
|
| 39 |
-
"Start calm, become angry in the middle, "
|
| 40 |
-
"end with a soft laugh"
|
| 41 |
-
),
|
| 42 |
-
lines=5
|
| 43 |
-
)
|
| 44 |
|
| 45 |
-
generate_btn = gr.Button("Generate (Skeleton
|
| 46 |
-
|
| 47 |
-
status_output = gr.Textbox(
|
| 48 |
-
label="Status",
|
| 49 |
-
interactive=False
|
| 50 |
-
)
|
| 51 |
|
| 52 |
generate_btn.click(
|
| 53 |
-
fn=
|
| 54 |
-
inputs=[
|
| 55 |
-
outputs=
|
| 56 |
)
|
| 57 |
|
| 58 |
demo.launch()
|
| 59 |
-
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
def generate_audio(prompt, text):
|
|
|
|
| 4 |
if not text.strip():
|
| 5 |
+
return "Text is empty."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
return f"ACTING PROMPT:\n{prompt}\n\nTEXT:\n{text}"
|
| 8 |
|
| 9 |
+
with gr.Blocks() as demo:
|
| 10 |
+
gr.Markdown("## 🎙️ FardaVoice – Acting Prompt TTS (Skeleton)")
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
acting_prompt = gr.Textbox(
|
| 13 |
+
label="🎭 Acting Prompt (Emotion + Style)",
|
| 14 |
+
placeholder="e.g. Speak slowly, deep sad voice, slight trembling, cinematic tone...",
|
| 15 |
+
lines=4
|
|
|
|
| 16 |
)
|
| 17 |
|
| 18 |
text_input = gr.Textbox(
|
| 19 |
+
label="📝 Text to Perform",
|
| 20 |
+
placeholder="Enter the text that should be acted...",
|
| 21 |
lines=6
|
| 22 |
)
|
| 23 |
|
| 24 |
+
output = gr.Textbox(label="Output (Temporary)")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
+
generate_btn = gr.Button("Generate (Skeleton)")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
generate_btn.click(
|
| 29 |
+
fn=generate_audio,
|
| 30 |
+
inputs=[acting_prompt, text_input],
|
| 31 |
+
outputs=output
|
| 32 |
)
|
| 33 |
|
| 34 |
demo.launch()
|
| 35 |
+
|