ankban commited on
Commit
07cd64d
Β·
verified Β·
1 Parent(s): c2bab79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -54
app.py CHANGED
@@ -99,69 +99,33 @@ def tutor_feedback(audio_file):
99
  return transcript, feedback_text, mp3_path
100
 
101
  # Gradio interface
102
- with gr.Blocks(css="""
103
- #header img {
104
- border-radius: 50%;
105
- border: 4px solid #ffffff;
106
- box-shadow: 0 4px 12px rgba(0,0,0,0.2);
107
- margin-bottom: 0.5em;
108
- animation: float 3s ease-in-out infinite;
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
- f"""
147
- <div style="text-align: center;">
148
- <img src="{chatter_owl_url}" width="120">
149
- <h2>πŸ¦‰ Hi, I'm <strong>Chatter the Owl</strong>!</h2>
150
- <p>Let's practice your speaking! Tap the mic, say something, and I’ll give you tips to get even better! πŸŽ‰</p>
151
  </div>
152
- """,
153
- elem_id="header"
154
  )
155
 
156
  with gr.Row():
157
- audio_input = gr.Audio(type="filepath", label="🎀 Say something here!")
158
 
159
  with gr.Row():
160
- transcript_box = gr.Textbox(label="πŸ“– What you said")
161
- feedback_box = gr.Textbox(label="πŸͺ„ Chatter's Feedback")
162
 
163
- audio_output = gr.Audio(label="πŸ”Š Chatter's Voice Reply", type="filepath")
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__":