Spaces:
Runtime error
Runtime error
Commit
·
175c5b3
1
Parent(s):
1701c77
updated code
Browse files
app.py
CHANGED
|
@@ -13,6 +13,7 @@ from keras.applications import VGG16
|
|
| 13 |
import os
|
| 14 |
import scipy
|
| 15 |
import gradio as gr
|
|
|
|
| 16 |
|
| 17 |
# Load the tune recognition model
|
| 18 |
model = tf.keras.models.load_model('embdmodel_1.hdf5')
|
|
@@ -69,8 +70,9 @@ def list_file_sizes():
|
|
| 69 |
|
| 70 |
def main(audio):
|
| 71 |
|
| 72 |
-
|
| 73 |
-
|
|
|
|
| 74 |
|
| 75 |
list_file_sizes()
|
| 76 |
|
|
@@ -145,41 +147,6 @@ def main(audio):
|
|
| 145 |
return audio_bytes
|
| 146 |
|
| 147 |
|
| 148 |
-
css = """
|
| 149 |
-
footer {display:none !important}
|
| 150 |
-
.output-markdown{display:none !important}
|
| 151 |
-
button.primary {
|
| 152 |
-
z-index: 14;
|
| 153 |
-
left: 0px;
|
| 154 |
-
top: 0px;
|
| 155 |
-
cursor: pointer !important;
|
| 156 |
-
background: none rgb(17, 20, 45) !important;
|
| 157 |
-
border: none !important;
|
| 158 |
-
color: rgb(255, 255, 255) !important;
|
| 159 |
-
line-height: 1 !important;
|
| 160 |
-
border-radius: 6px !important;
|
| 161 |
-
transition: box-shadow 200ms ease 0s, background 200ms ease 0s !important;
|
| 162 |
-
box-shadow: none !important;
|
| 163 |
-
}
|
| 164 |
-
button.primary:hover{
|
| 165 |
-
z-index: 14;
|
| 166 |
-
left: 0px;
|
| 167 |
-
top: 0px;
|
| 168 |
-
cursor: pointer !important;
|
| 169 |
-
background: none rgb(37, 56, 133) !important;
|
| 170 |
-
border: none !important;
|
| 171 |
-
color: rgb(255, 255, 255) !important;
|
| 172 |
-
line-height: 1 !important;
|
| 173 |
-
border-radius: 6px !important;
|
| 174 |
-
transition: box-shadow 200ms ease 0s, background 200ms ease 0s !important;
|
| 175 |
-
box-shadow: rgb(0 0 0 / 23%) 0px 1px 7px 0px !important;
|
| 176 |
-
}
|
| 177 |
-
button.gallery-item:hover {
|
| 178 |
-
border-color: rgb(37 56 133) !important;
|
| 179 |
-
background-color: rgb(229,225,255) !important;
|
| 180 |
-
}
|
| 181 |
-
"""
|
| 182 |
-
|
| 183 |
import asyncio
|
| 184 |
loop = asyncio.new_event_loop()
|
| 185 |
asyncio.set_event_loop(loop)
|
|
@@ -191,7 +158,5 @@ mf_transcribe = gr.Interface(
|
|
| 191 |
outputs="audio",
|
| 192 |
layout="horizontal",
|
| 193 |
theme="huggingface",
|
| 194 |
-
allow_flagging="never",
|
| 195 |
-
css = css
|
| 196 |
)
|
| 197 |
-
mf_transcribe.launch(
|
|
|
|
| 13 |
import os
|
| 14 |
import scipy
|
| 15 |
import gradio as gr
|
| 16 |
+
import shutil
|
| 17 |
|
| 18 |
# Load the tune recognition model
|
| 19 |
model = tf.keras.models.load_model('embdmodel_1.hdf5')
|
|
|
|
| 70 |
|
| 71 |
def main(audio):
|
| 72 |
|
| 73 |
+
print(audio)
|
| 74 |
+
|
| 75 |
+
shutil.copy(audio, "./my_audio.wav")
|
| 76 |
|
| 77 |
list_file_sizes()
|
| 78 |
|
|
|
|
| 147 |
return audio_bytes
|
| 148 |
|
| 149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
import asyncio
|
| 151 |
loop = asyncio.new_event_loop()
|
| 152 |
asyncio.set_event_loop(loop)
|
|
|
|
| 158 |
outputs="audio",
|
| 159 |
layout="horizontal",
|
| 160 |
theme="huggingface",
|
|
|
|
|
|
|
| 161 |
)
|
| 162 |
+
mf_transcribe.launch()
|