NatalieElizabeth commited on
Commit
2e943b4
·
1 Parent(s): b33dda8

imported spaces, added gpu decorator, fixed launch time with "share -> false"

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -2,6 +2,7 @@ import os
2
  import torch
3
  import torchaudio
4
  import argparse
 
5
  from huggingface_hub import hf_hub_download
6
 
7
  # For PyHARP wrapper
@@ -25,6 +26,7 @@ def save_audio(file_path, audio, samplerate=44100):
25
  torchaudio.save(file_path, audio, samplerate)
26
 
27
  #Defining the process function
 
28
  @torch.inference_mode()
29
  def process_fn(
30
  input_audio_path: str
@@ -127,7 +129,7 @@ with gr.Blocks() as demo:
127
  )
128
 
129
  # run the thing
130
- demo.queue().launch(share=True, show_error=False, pwa=True)
131
 
132
  # original inference function run
133
  '''
 
2
  import torch
3
  import torchaudio
4
  import argparse
5
+ import spaces
6
  from huggingface_hub import hf_hub_download
7
 
8
  # For PyHARP wrapper
 
26
  torchaudio.save(file_path, audio, samplerate)
27
 
28
  #Defining the process function
29
+ @spaces.GPU
30
  @torch.inference_mode()
31
  def process_fn(
32
  input_audio_path: str
 
129
  )
130
 
131
  # run the thing
132
+ demo.queue().launch(show_error=True, pwa=True)
133
 
134
  # original inference function run
135
  '''