Update app.py
Browse files
app.py
CHANGED
|
@@ -55,6 +55,48 @@ def text_to_speech_english(text):
|
|
| 55 |
audio_data = speech["audio"]
|
| 56 |
sampling_rate = speech["sampling_rate"]
|
| 57 |
return (sampling_rate, audio_data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
examples = [
|
| 60 |
#First parameter is for the dropdown menu, and the second parameter is for the starter of the poem
|
|
@@ -73,6 +115,7 @@ interface = gr.Interface(
|
|
| 73 |
gr.Audio(label="Generated Audio", type="numpy")
|
| 74 |
],
|
| 75 |
|
| 76 |
-
examples=examples
|
|
|
|
| 77 |
)
|
| 78 |
interface.launch()
|
|
|
|
| 55 |
audio_data = speech["audio"]
|
| 56 |
sampling_rate = speech["sampling_rate"]
|
| 57 |
return (sampling_rate, audio_data)
|
| 58 |
+
custom_css = """
|
| 59 |
+
body {
|
| 60 |
+
background-color: #f4f4f9;
|
| 61 |
+
color: #333;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.gradio-container {
|
| 65 |
+
border-radius: 10px;
|
| 66 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
| 67 |
+
background-color: #fff;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
label {
|
| 71 |
+
color: #4A90E2;
|
| 72 |
+
font-weight: bold;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
input[type="text"], textarea {
|
| 76 |
+
border: 1px solid #4A90E2;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
textarea {
|
| 80 |
+
height: 150px;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
button {
|
| 84 |
+
background-color: #4A90E2;
|
| 85 |
+
color: #fff;
|
| 86 |
+
border-radius: 5px;
|
| 87 |
+
cursor: pointer;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
button:hover {
|
| 91 |
+
background-color: #357ABD;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
.dropdown {
|
| 95 |
+
border: 1px solid #4A90E2;
|
| 96 |
+
border-radius: 4px;
|
| 97 |
+
}
|
| 98 |
+
"""
|
| 99 |
+
|
| 100 |
|
| 101 |
examples = [
|
| 102 |
#First parameter is for the dropdown menu, and the second parameter is for the starter of the poem
|
|
|
|
| 115 |
gr.Audio(label="Generated Audio", type="numpy")
|
| 116 |
],
|
| 117 |
|
| 118 |
+
examples=examples,
|
| 119 |
+
css.custum_css
|
| 120 |
)
|
| 121 |
interface.launch()
|