Spaces:
Runtime error
Runtime error
Commit ·
a99daf7
1
Parent(s): 2e943b4
app.py cleanup, load/save_audio removal from pyharp since they're unused
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import spaces
|
|
| 6 |
from huggingface_hub import hf_hub_download
|
| 7 |
|
| 8 |
# For PyHARP wrapper
|
| 9 |
-
from pyharp import ModelCard, build_endpoint
|
| 10 |
import gradio as gr
|
| 11 |
|
| 12 |
# Create a ModelCard
|
|
@@ -76,8 +76,6 @@ def process_fn(
|
|
| 76 |
model.eval()
|
| 77 |
print("✓ Model loaded successfully")
|
| 78 |
|
| 79 |
-
# Commenting out excess print statement bc it uses input.wav
|
| 80 |
-
# print(f"Processing audio: {input_wav}")
|
| 81 |
sig = load_audio(input_audio_path)
|
| 82 |
|
| 83 |
# Move audio data to device
|
|
@@ -100,10 +98,6 @@ def process_fn(
|
|
| 100 |
|
| 101 |
return output_audio_path
|
| 102 |
|
| 103 |
-
# original export method
|
| 104 |
-
# save_audio(output_wav, out)
|
| 105 |
-
# print(f"✓ Saved output to {output_wav}")
|
| 106 |
-
|
| 107 |
# Build Gradio endpoint
|
| 108 |
with gr.Blocks() as demo:
|
| 109 |
# Define input Gradio Components
|
|
@@ -128,16 +122,5 @@ with gr.Blocks() as demo:
|
|
| 128 |
process_fn=process_fn,
|
| 129 |
)
|
| 130 |
|
| 131 |
-
# run the
|
| 132 |
-
demo.queue().launch(show_error=True, pwa=True)
|
| 133 |
-
|
| 134 |
-
# original inference function run
|
| 135 |
-
'''
|
| 136 |
-
if __name__ == "__main__":
|
| 137 |
-
parser = argparse.ArgumentParser(description="Audio Inference Script")
|
| 138 |
-
parser.add_argument("--in_wav", type=str, required=True, help="Path to input wav file")
|
| 139 |
-
parser.add_argument("--out_wav", type=str, required=True, help="Path to output wav file")
|
| 140 |
-
args = parser.parse_args()
|
| 141 |
-
|
| 142 |
-
main(args.in_wav, args.out_wav)
|
| 143 |
-
'''
|
|
|
|
| 6 |
from huggingface_hub import hf_hub_download
|
| 7 |
|
| 8 |
# For PyHARP wrapper
|
| 9 |
+
from pyharp import ModelCard, build_endpoint
|
| 10 |
import gradio as gr
|
| 11 |
|
| 12 |
# Create a ModelCard
|
|
|
|
| 76 |
model.eval()
|
| 77 |
print("✓ Model loaded successfully")
|
| 78 |
|
|
|
|
|
|
|
| 79 |
sig = load_audio(input_audio_path)
|
| 80 |
|
| 81 |
# Move audio data to device
|
|
|
|
| 98 |
|
| 99 |
return output_audio_path
|
| 100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
# Build Gradio endpoint
|
| 102 |
with gr.Blocks() as demo:
|
| 103 |
# Define input Gradio Components
|
|
|
|
| 122 |
process_fn=process_fn,
|
| 123 |
)
|
| 124 |
|
| 125 |
+
# run the model
|
| 126 |
+
demo.queue().launch(show_error=True, pwa=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|