mirror of
https://github.com/hpcaitech/Open-Sora.git
synced 2026-05-20 17:35:58 +02:00
♻️ Directory creation to use os.makedirs with exist_ok (#435)
Simplified code and improved readability / Ensured functionality remains the same by allowing directory to exist without error
This commit is contained in:
parent
23f6a1e4c7
commit
7a0727757f
|
|
@ -52,8 +52,7 @@ def read_file(input_path):
|
|||
|
||||
def download_url(input_path):
|
||||
output_dir = "cache"
|
||||
if not os.path.exists(output_dir):
|
||||
os.makedirs(output_dir)
|
||||
os.makedirs(output_dir, exist_ok=True)
|
||||
base_name = os.path.basename(input_path)
|
||||
output_path = os.path.join(output_dir, base_name)
|
||||
img_data = requests.get(input_path).content
|
||||
|
|
|
|||
Loading…
Reference in a new issue