Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,12 @@ import soundfile as sf
|
|
7 |
import io
|
8 |
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
def audio_to_bytes(audio):
|
11 |
data, sr = sf.read(audio)
|
12 |
audio_bytes = io.BytesIO()
|
@@ -164,6 +170,27 @@ button.selected::after{
|
|
164 |
demo = gr.Blocks(css=css_content) #, fill_width=True)
|
165 |
with demo:
|
166 |
gr.HTML("""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
<div id="header">
|
168 |
<h1>LANGSWITCH</h1>
|
169 |
<h3>Multilingual Automatic Speech Recognition in noisy environments</h3>
|
@@ -207,6 +234,15 @@ with demo:
|
|
207 |
],
|
208 |
allow_flagging="never",
|
209 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
|
211 |
gr.HTML("""
|
212 |
<div id="orai-info">
|
|
|
7 |
import io
|
8 |
|
9 |
|
10 |
+
def show_popup():
|
11 |
+
return gr.update(visible=True)
|
12 |
+
|
13 |
+
def hide_popup():
|
14 |
+
return gr.update(visible=False)
|
15 |
+
|
16 |
def audio_to_bytes(audio):
|
17 |
data, sr = sf.read(audio)
|
18 |
audio_bytes = io.BytesIO()
|
|
|
170 |
demo = gr.Blocks(css=css_content) #, fill_width=True)
|
171 |
with demo:
|
172 |
gr.HTML("""
|
173 |
+
<style>
|
174 |
+
.popup-overlay {
|
175 |
+
position: fixed;
|
176 |
+
top: 0; left: 0;
|
177 |
+
width: 100vw; height: 100vh;
|
178 |
+
background: rgba(0,0,0,0.5);
|
179 |
+
display: flex; justify-content: center; align-items: center;
|
180 |
+
z-index: 10;
|
181 |
+
}
|
182 |
+
.popup-box {
|
183 |
+
background: white;
|
184 |
+
padding: 20px;
|
185 |
+
border-radius: 10px;
|
186 |
+
box-shadow: 0 0 20px rgba(0,0,0,0.2);
|
187 |
+
text-align: center;
|
188 |
+
width: 300px;
|
189 |
+
}
|
190 |
+
</style>
|
191 |
+
""")
|
192 |
+
|
193 |
+
gr.HTML("""
|
194 |
<div id="header">
|
195 |
<h1>LANGSWITCH</h1>
|
196 |
<h3>Multilingual Automatic Speech Recognition in noisy environments</h3>
|
|
|
234 |
],
|
235 |
allow_flagging="never",
|
236 |
)
|
237 |
+
|
238 |
+
popup = gr.Column(visible=False)
|
239 |
+
with popup:
|
240 |
+
gr.HTML('<div class="popup-overlay"><div class="popup-box">')
|
241 |
+
gr.Markdown("Grabaketak ez dira gordetzen eta automatikoki ezabatzen dira.\nNo se guardan las grabaciones y se eliminan automáticamente.\nThe recordings are not saved and are automatically removed.")
|
242 |
+
gr.Button("OK", onclick=hide_popup)
|
243 |
+
gr.HTML('</div></div>')
|
244 |
+
|
245 |
+
gr.Button("Show Message", onclick=show_popup)
|
246 |
|
247 |
gr.HTML("""
|
248 |
<div id="orai-info">
|