JacobLinCool commited on
Commit
b0f46ba
1 Parent(s): 0ae5ec9

fix: preventing multi-process

Browse files
Files changed (2) hide show
  1. app.py +3 -2
  2. infer/modules/train/train.py +1 -1
app.py CHANGED
@@ -202,7 +202,8 @@ def download_expdir(exp_dir: str) -> str:
202
  return f"{exp_dir}.zip"
203
 
204
 
205
- def restore_expdir(zip: str, exp_dir: str) -> str:
 
206
  shutil.unpack_archive(zip, exp_dir)
207
  return exp_dir
208
 
@@ -290,7 +291,7 @@ with gr.Blocks() as app:
290
 
291
  restore_btn.click(
292
  fn=restore_expdir,
293
- inputs=[restore_zip_file, exp_dir],
294
  outputs=[exp_dir],
295
  )
296
 
 
202
  return f"{exp_dir}.zip"
203
 
204
 
205
+ def restore_expdir(zip: str) -> str:
206
+ exp_dir = tempfile.mkdtemp()
207
  shutil.unpack_archive(zip, exp_dir)
208
  return exp_dir
209
 
 
291
 
292
  restore_btn.click(
293
  fn=restore_expdir,
294
+ inputs=[restore_zip_file],
295
  outputs=[exp_dir],
296
  )
297
 
infer/modules/train/train.py CHANGED
@@ -147,7 +147,7 @@ def run(rank, n_gpus, hps, logger: logging.Logger, state):
147
  collate_fn = TextAudioCollate()
148
  train_loader = DataLoader(
149
  train_dataset,
150
- num_workers=4,
151
  shuffle=False,
152
  pin_memory=True,
153
  collate_fn=collate_fn,
 
147
  collate_fn = TextAudioCollate()
148
  train_loader = DataLoader(
149
  train_dataset,
150
+ # num_workers=4,
151
  shuffle=False,
152
  pin_memory=True,
153
  collate_fn=collate_fn,