Update app.py
Browse files
app.py
CHANGED
|
@@ -99,69 +99,33 @@ def tutor_feedback(audio_file):
|
|
| 99 |
return transcript, feedback_text, mp3_path
|
| 100 |
|
| 101 |
# Gradio interface
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
}
|
| 110 |
-
|
| 111 |
-
@keyframes float {
|
| 112 |
-
0% { transform: translateY(0px); }
|
| 113 |
-
50% { transform: translateY(-10px); }
|
| 114 |
-
100% { transform: translateY(0px); }
|
| 115 |
-
}
|
| 116 |
-
|
| 117 |
-
.gradio-container {
|
| 118 |
-
background: linear-gradient(to bottom, #f6f9ff, #ffffff);
|
| 119 |
-
font-family: 'Comic Sans MS', 'Comic Neue', cursive;
|
| 120 |
-
}
|
| 121 |
-
|
| 122 |
-
h2 {
|
| 123 |
-
color: #673ab7;
|
| 124 |
-
font-size: 1.8em;
|
| 125 |
-
}
|
| 126 |
-
|
| 127 |
-
.gr-button {
|
| 128 |
-
font-size: 1.1em;
|
| 129 |
-
background-color: #ffca28 !important;
|
| 130 |
-
border-radius: 12px !important;
|
| 131 |
-
color: black !important;
|
| 132 |
-
font-weight: bold;
|
| 133 |
-
}
|
| 134 |
-
|
| 135 |
-
.gr-textbox textarea {
|
| 136 |
-
font-size: 1.1em;
|
| 137 |
-
border-radius: 12px !important;
|
| 138 |
-
padding: 1em;
|
| 139 |
-
}
|
| 140 |
-
|
| 141 |
-
.gr-audio label {
|
| 142 |
-
font-size: 1.1em;
|
| 143 |
-
}
|
| 144 |
-
""") as iface:
|
| 145 |
gr.Markdown(
|
| 146 |
-
|
| 147 |
-
<div style="text-align: center;">
|
| 148 |
-
<img src="
|
| 149 |
-
<h2>π¦
|
| 150 |
-
<p>
|
| 151 |
</div>
|
| 152 |
-
"""
|
| 153 |
-
elem_id="header"
|
| 154 |
)
|
| 155 |
|
| 156 |
with gr.Row():
|
| 157 |
-
audio_input = gr.Audio(type="filepath", label="
|
| 158 |
|
| 159 |
with gr.Row():
|
| 160 |
-
transcript_box = gr.Textbox(label="π What
|
| 161 |
-
feedback_box = gr.Textbox(label="
|
| 162 |
|
| 163 |
-
audio_output = gr.Audio(label="π
|
| 164 |
|
|
|
|
| 165 |
audio_input.change(fn=tutor_feedback, inputs=audio_input, outputs=[transcript_box, feedback_box, audio_output])
|
| 166 |
|
| 167 |
if __name__ == "__main__":
|
|
|
|
| 99 |
return transcript, feedback_text, mp3_path
|
| 100 |
|
| 101 |
# Gradio interface
|
| 102 |
+
# Path to your CSS file
|
| 103 |
+
css_path = "light_mode_chatter_owl.css" # Make sure this file is in the same directory as app.py
|
| 104 |
+
|
| 105 |
+
# Path to your CSS file
|
| 106 |
+
css_path = "light_mode_chatter_owl.css" # Make sure this file is in the same directory as app.py
|
| 107 |
+
|
| 108 |
+
with gr.Blocks(css=css_path) as app:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
gr.Markdown(
|
| 110 |
+
"""
|
| 111 |
+
<div id="header" style="text-align: center;">
|
| 112 |
+
<img src="file/images/chatter_owl.png">
|
| 113 |
+
<h2>π¦ Meet Chatter the Owl!</h2>
|
| 114 |
+
<p>Speak to me and I'll help you become a confident communicator. π€β¨</p>
|
| 115 |
</div>
|
| 116 |
+
"""
|
|
|
|
| 117 |
)
|
| 118 |
|
| 119 |
with gr.Row():
|
| 120 |
+
audio_input = gr.Audio(type="filepath", label="π Speak or Upload Audio")
|
| 121 |
|
| 122 |
with gr.Row():
|
| 123 |
+
transcript_box = gr.Textbox(label="π What You Said")
|
| 124 |
+
feedback_box = gr.Textbox(label="π‘ Chatter's Feedback")
|
| 125 |
|
| 126 |
+
audio_output = gr.Audio(label="π Spoken Feedback", type="filepath")
|
| 127 |
|
| 128 |
+
# Hook up your function (e.g., `tutor_feedback`)
|
| 129 |
audio_input.change(fn=tutor_feedback, inputs=audio_input, outputs=[transcript_box, feedback_box, audio_output])
|
| 130 |
|
| 131 |
if __name__ == "__main__":
|