Spaces:
Runtime error
Runtime error
Commit ·
9099754
1
Parent(s): 2839bc9
Update app.py
Browse files42 unmodified lines434445464748495051525354555657586 unmodified lines6566676869707120 unmodified lines929394959697989910010110242 unmodified linesfor d in res['genres']:genres[d['name']] = d['probability']themes = []for d in res['themes']:themes.append((d['name'],d['probability']))print(themes)instruments = []for d in res['instruments']:instruments.append((d['name'],d['probability']))print(instruments)timbres = []for d in res['timbres']:6 unmodified linesaudioquality = [res['audio_quality'][0]['name'], res['audio_quality'][0]['probability']]print(audioquality)return dict_moods, dict_desc, genresdemo = gr.Interface(fn=process,20 unmodified lineswith gr.Row():dict_moods=gr.outputs.Label(label="Moods")dict_desc=gr.outputs.Label(label="Descriptors")genres = gr.outputs.Label(label="Genres")analyze_btn.click(process, inputs=[audio_input], outputs=[dict_moods, dict_desc, genres])#audio_input.submit(process, inputs=[audio_input], outputs=[moods]) # pas de sens !demo.launch(debug=False)42 unmodified lines434445464748495051525354556 unmodified lines6263646566676820 unmodified lines899091929394959697989910042 unmodified linesfor d in res['genres']:genres[d['name']] = d['probability']themes = {}for d in res['themes']:themes[d['name']]= d['probability']instruments = {}for d in res['instruments']:instruments[d['name']] = d['probability']timbres = []for d in res['timbres']:6 unmodified linesaudioquality = [res['audio_quality'][0]['name'], res['audio_quality'][0]['probability']]print(audioquality)return dict_moods, dict_desc, genres, instruments, themesdemo = gr.Interface(fn=process,20 unmodified lineswith gr.Row():dict_moods=gr.outputs.Label(label="Moods")themes=gr.outputs.Label(label="Themes")genres = gr.outputs.Label(label="Genres")instruments = gr.outputs.Label(label="Instruments")analyze_btn.click(process, inputs=[audio_input], outputs=[dict_moods, dict_desc, genres, instruments, themes])#audio_input.submit(process, inputs=[audio_input], outputs=[moods]) # pas de sens !demo.launch(debug=False)
app.py+9-11