Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,19 +1,17 @@
|
|
| 1 |
import argparse
|
| 2 |
import glob
|
|
|
|
| 3 |
|
| 4 |
-
import PIL
|
| 5 |
import gradio as gr
|
| 6 |
import numpy as np
|
| 7 |
-
import
|
| 8 |
-
|
| 9 |
-
import torch.nn.functional as F
|
| 10 |
import tqdm
|
|
|
|
|
|
|
| 11 |
|
| 12 |
import MIDI
|
| 13 |
-
from midi_model import MIDIModel
|
| 14 |
-
from midi_tokenizer import MIDITokenizer
|
| 15 |
from midi_synthesizer import synthesis
|
| 16 |
-
from
|
| 17 |
in_space = os.getenv("SYSTEM") == "spaces"
|
| 18 |
@torch.inference_mode()
|
| 19 |
def generate(prompt=None, max_len=512, temp=1.0, top_p=0.98, top_k=20,
|
|
|
|
| 1 |
import argparse
|
| 2 |
import glob
|
| 3 |
+
import os.path
|
| 4 |
|
|
|
|
| 5 |
import gradio as gr
|
| 6 |
import numpy as np
|
| 7 |
+
import onnxruntime as rt
|
|
|
|
|
|
|
| 8 |
import tqdm
|
| 9 |
+
import json
|
| 10 |
+
from huggingface_hub import hf_hub_download
|
| 11 |
|
| 12 |
import MIDI
|
|
|
|
|
|
|
| 13 |
from midi_synthesizer import synthesis
|
| 14 |
+
from midi_tokenizer import MIDITokenizer
|
| 15 |
in_space = os.getenv("SYSTEM") == "spaces"
|
| 16 |
@torch.inference_mode()
|
| 17 |
def generate(prompt=None, max_len=512, temp=1.0, top_p=0.98, top_k=20,
|