Spaces:
Runtime error
Runtime error
ShaoTengLiu
commited on
Commit
·
a53b979
1
Parent(s):
2c84bf4
update
Browse files- trainer.py +2 -2
trainer.py
CHANGED
@@ -41,11 +41,11 @@ class Trainer:
|
|
41 |
org_dir = self.checkpoint_dir / org_name
|
42 |
org_dir.mkdir(exist_ok=True)
|
43 |
print(f'https://huggingface.co/{base_model_id}')
|
44 |
-
|
45 |
subprocess.run(shlex.split(
|
46 |
f'git clone https://huggingface.co/{base_model_id}'),
|
47 |
cwd=org_dir)
|
48 |
-
|
49 |
temp_path = huggingface_hub.snapshot_download(base_model_id, use_auth_token=token)
|
50 |
print(temp_path, org_dir)
|
51 |
subprocess.run(shlex.split(f'mv {temp_path} {org_dir}'))
|
|
|
41 |
org_dir = self.checkpoint_dir / org_name
|
42 |
org_dir.mkdir(exist_ok=True)
|
43 |
print(f'https://huggingface.co/{base_model_id}')
|
44 |
+
if token == None:
|
45 |
subprocess.run(shlex.split(
|
46 |
f'git clone https://huggingface.co/{base_model_id}'),
|
47 |
cwd=org_dir)
|
48 |
+
else:
|
49 |
temp_path = huggingface_hub.snapshot_download(base_model_id, use_auth_token=token)
|
50 |
print(temp_path, org_dir)
|
51 |
subprocess.run(shlex.split(f'mv {temp_path} {org_dir}'))
|