fffiloni commited on
Commit
c6e84c6
1 Parent(s): 22c4e50

Update hf_gradio_app.py

Browse files
Files changed (1) hide show
  1. hf_gradio_app.py +5 -4
hf_gradio_app.py CHANGED
@@ -122,10 +122,11 @@ def generate(input_video, input_audio, seed, progress=gr.Progress(track_tqdm=Tru
122
  os.makedirs(cache_dir, exist_ok=True)
123
  input_audio = resample_audio(input_audio, os.path.join(cache_dir, f"{os.path.basename(input_audio).split('.')[0]}-16k.wav"))
124
 
125
- # Clean up the temporary directory
126
- if os.path.exists(temp_dir):
127
- shutil.rmtree(temp_dir)
128
- print(f"Temporary directory {temp_dir} deleted.")
 
129
 
130
  audio_emb, audio_length = preprocess_audio(
131
  wav_path=input_audio,
 
122
  os.makedirs(cache_dir, exist_ok=True)
123
  input_audio = resample_audio(input_audio, os.path.join(cache_dir, f"{os.path.basename(input_audio).split('.')[0]}-16k.wav"))
124
 
125
+ if is_shared_ui:
126
+ # Clean up the temporary directory
127
+ if os.path.exists(temp_dir):
128
+ shutil.rmtree(temp_dir)
129
+ print(f"Temporary directory {temp_dir} deleted.")
130
 
131
  audio_emb, audio_length = preprocess_audio(
132
  wav_path=input_audio,