spaces fix
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import os
|
| 2 |
-
|
| 3 |
import gradio as gr
|
| 4 |
import torch
|
| 5 |
from dataclasses import asdict
|
|
@@ -188,7 +188,7 @@ def auto_extract_melody(mid, debug=False):
|
|
| 188 |
|
| 189 |
return events, melody
|
| 190 |
|
| 191 |
-
|
| 192 |
# Core generation
|
| 193 |
def generate_accompaniment(midi_path: str, model_choice: str, history_length: float):
|
| 194 |
"""
|
|
|
|
| 1 |
import os
|
| 2 |
+
import spaces # Enables ZeroGPU on Hugging Face
|
| 3 |
import gradio as gr
|
| 4 |
import torch
|
| 5 |
from dataclasses import asdict
|
|
|
|
| 188 |
|
| 189 |
return events, melody
|
| 190 |
|
| 191 |
+
@spaces.GPU
|
| 192 |
# Core generation
|
| 193 |
def generate_accompaniment(midi_path: str, model_choice: str, history_length: float):
|
| 194 |
"""
|