jmole commited on
Commit
8bf247f
·
verified ·
1 Parent(s): d8b1d07

Update app.py

Browse files

Creates parent directories if they don't exist, otherwise I get the error:
```
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/spaces/YuE/.venv/lib/python3.10/site-packages/gradio/utils.py", line 285, in watchfn
exec(no_reload_source_code, module.__dict__)
File "/spaces/YuE/app.py", line 33, in <module>
os.mkdir(folder_path)
FileNotFoundError: [Errno 2] No such file or directory: './inference/xcodec_mini_infer'
```

Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -30,7 +30,7 @@ folder_path = './inference/xcodec_mini_infer'
30
 
31
  # Create the folder if it doesn't exist
32
  if not os.path.exists(folder_path):
33
- os.mkdir(folder_path)
34
  print(f"Folder created at: {folder_path}")
35
  else:
36
  print(f"Folder already exists at: {folder_path}")
 
30
 
31
  # Create the folder if it doesn't exist
32
  if not os.path.exists(folder_path):
33
+ os.makedirs(folder_path)
34
  print(f"Folder created at: {folder_path}")
35
  else:
36
  print(f"Folder already exists at: {folder_path}")