Spaces:
Running on Zero
Running on Zero
add startup debug prints
Browse files
app.py
CHANGED
|
@@ -18,10 +18,13 @@ print("gradio imported", flush=True)
|
|
| 18 |
import random
|
| 19 |
print("random imported", flush=True)
|
| 20 |
|
|
|
|
| 21 |
os.environ["TOKENIZERS_PARALLELISM"] = "true"
|
| 22 |
torch.set_float32_matmul_precision("high")
|
|
|
|
| 23 |
|
| 24 |
model = None
|
|
|
|
| 25 |
|
| 26 |
def get_model():
|
| 27 |
global model
|
|
@@ -37,6 +40,7 @@ model_card = ModelCard(
|
|
| 37 |
author="Haohe Liu, Ke Chen, Qiao Tian, Wenwu Wang, Mark D. Plumbley",
|
| 38 |
tags=["audio", "super-resolution", "upsampling", "48kHz"],
|
| 39 |
)
|
|
|
|
| 40 |
|
| 41 |
@torch.inference_mode()
|
| 42 |
def process_fn(input_audio_path: str, ddim_steps: int, guidance_scale: float, seed: str) -> str:
|
|
@@ -65,6 +69,7 @@ def process_fn(input_audio_path: str, ddim_steps: int, guidance_scale: float, se
|
|
| 65 |
return output_path
|
| 66 |
|
| 67 |
with gr.Blocks() as demo:
|
|
|
|
| 68 |
input_components = [
|
| 69 |
gr.Audio(type="filepath", label="Input Audio").harp_required(True),
|
| 70 |
gr.Slider(minimum=10, maximum=500, step=10, value=50,
|
|
@@ -84,5 +89,6 @@ with gr.Blocks() as demo:
|
|
| 84 |
output_components=output_components,
|
| 85 |
process_fn=process_fn,
|
| 86 |
)
|
|
|
|
| 87 |
|
| 88 |
demo.queue().launch(share=True, show_error=True, pwa=True)
|
|
|
|
| 18 |
import random
|
| 19 |
print("random imported", flush=True)
|
| 20 |
|
| 21 |
+
print("Setting env vars", flush=True)
|
| 22 |
os.environ["TOKENIZERS_PARALLELISM"] = "true"
|
| 23 |
torch.set_float32_matmul_precision("high")
|
| 24 |
+
print("Env vars set", flush=True)
|
| 25 |
|
| 26 |
model = None
|
| 27 |
+
print("Model variable initialized", flush=True)
|
| 28 |
|
| 29 |
def get_model():
|
| 30 |
global model
|
|
|
|
| 40 |
author="Haohe Liu, Ke Chen, Qiao Tian, Wenwu Wang, Mark D. Plumbley",
|
| 41 |
tags=["audio", "super-resolution", "upsampling", "48kHz"],
|
| 42 |
)
|
| 43 |
+
print("Model card created", flush=True)
|
| 44 |
|
| 45 |
@torch.inference_mode()
|
| 46 |
def process_fn(input_audio_path: str, ddim_steps: int, guidance_scale: float, seed: str) -> str:
|
|
|
|
| 69 |
return output_path
|
| 70 |
|
| 71 |
with gr.Blocks() as demo:
|
| 72 |
+
print("Gradio blocks created", flush=True)
|
| 73 |
input_components = [
|
| 74 |
gr.Audio(type="filepath", label="Input Audio").harp_required(True),
|
| 75 |
gr.Slider(minimum=10, maximum=500, step=10, value=50,
|
|
|
|
| 89 |
output_components=output_components,
|
| 90 |
process_fn=process_fn,
|
| 91 |
)
|
| 92 |
+
print("Endpoint built", flush=True)
|
| 93 |
|
| 94 |
demo.queue().launch(share=True, show_error=True, pwa=True)
|