Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,50 +1,37 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
|
| 4 |
-
|
| 5 |
-
# Assicurati che i nomi dei file su HF siano IDENTICI a questi
|
| 6 |
-
MODEL_PATH = "aura_engine_weights.ckpt"
|
| 7 |
-
CONFIG_PATH = "aura_config.yaml"
|
| 8 |
-
|
| 9 |
-
def aura_separator_process(audio, model_name):
|
| 10 |
-
"""
|
| 11 |
-
Funzione di test per verificare il collegamento Sito -> Hugging Face.
|
| 12 |
-
"""
|
| 13 |
if audio is None:
|
| 14 |
return None, None
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
print(f"Modello richiesto: {model_name}")
|
| 18 |
-
print(f"File ricevuto: {audio}")
|
| 19 |
-
|
| 20 |
-
# Per ora restituiamo l'audio originale per confermare che il 'ponte' funziona
|
| 21 |
return audio, audio
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
with gr.Blocks(
|
| 25 |
-
gr.Markdown("# 🌌 Aura Engine
|
| 26 |
|
| 27 |
with gr.Row():
|
| 28 |
-
input_audio = gr.Audio(label="
|
| 29 |
-
|
| 30 |
choices=["AuraAI-V1-Precision"],
|
| 31 |
value="AuraAI-V1-Precision",
|
| 32 |
-
label="
|
| 33 |
)
|
| 34 |
|
| 35 |
-
|
| 36 |
|
| 37 |
with gr.Row():
|
| 38 |
-
|
| 39 |
-
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
outputs=[out_vocals, out_inst],
|
| 46 |
api_name="predict"
|
| 47 |
)
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
|
| 4 |
+
def aura_process(audio, model_name):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
if audio is None:
|
| 6 |
return None, None
|
| 7 |
+
print(f"Richiesta Aura: {model_name}")
|
| 8 |
+
# Temporaneo: restituiamo l'audio originale per testare il ponte
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
return audio, audio
|
| 10 |
|
| 11 |
+
# In Gradio 6.0, definiamo i blocchi senza parametri
|
| 12 |
+
with gr.Blocks() as demo:
|
| 13 |
+
gr.Markdown("# 🌌 Aura Engine Core v1.0")
|
| 14 |
|
| 15 |
with gr.Row():
|
| 16 |
+
input_audio = gr.Audio(label="Stream Input", type="filepath")
|
| 17 |
+
model_select = gr.Dropdown(
|
| 18 |
choices=["AuraAI-V1-Precision"],
|
| 19 |
value="AuraAI-V1-Precision",
|
| 20 |
+
label="Motore AI"
|
| 21 |
)
|
| 22 |
|
| 23 |
+
btn = gr.Button("ELABORA CON AURA", variant="primary")
|
| 24 |
|
| 25 |
with gr.Row():
|
| 26 |
+
vocal_out = gr.Audio(label="🎤 Vocals")
|
| 27 |
+
inst_out = gr.Audio(label="🎸 Instrumental")
|
| 28 |
|
| 29 |
+
btn.click(
|
| 30 |
+
fn=aura_process,
|
| 31 |
+
inputs=[input_audio, model_select],
|
| 32 |
+
outputs=[vocal_out, inst_out],
|
|
|
|
| 33 |
api_name="predict"
|
| 34 |
)
|
| 35 |
|
| 36 |
+
# In Gradio 6.0, il tema si sposta nel launch() e show_api è automatico
|
| 37 |
+
demo.launch(theme=gr.themes.Base())
|