Spaces:
Sleeping
Sleeping
Update script.py
Browse files
script.py
CHANGED
|
@@ -124,8 +124,13 @@ def run_training(hf_dataset_path: str):
|
|
| 124 |
# run training
|
| 125 |
if not os.path.exists("ai-toolkit"):
|
| 126 |
commands = "git clone https://github.com/DevW1ld/ai-toolkit.git ai-toolkit && cd ai-toolkit && git submodule update --init --recursive"
|
|
|
|
|
|
|
| 127 |
subprocess.run(commands, shell=True)
|
| 128 |
|
|
|
|
|
|
|
|
|
|
| 129 |
# patch_ai_toolkit_typing()
|
| 130 |
commands = f"python run.py {os.path.join(dataset_dir, 'config.yaml')}"
|
| 131 |
process = subprocess.Popen(commands, shell=True, cwd="ai-toolkit", env=os.environ, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True,)
|
|
|
|
| 124 |
# run training
|
| 125 |
if not os.path.exists("ai-toolkit"):
|
| 126 |
commands = "git clone https://github.com/DevW1ld/ai-toolkit.git ai-toolkit && cd ai-toolkit && git submodule update --init --recursive"
|
| 127 |
+
shutil.rmtree(os.path.join(toolkit_src, ".git"), ignore_errors=True)
|
| 128 |
+
shutil.rmtree(os.path.join(toolkit_src, ".gitmodules"), ignore_errors=True)
|
| 129 |
subprocess.run(commands, shell=True)
|
| 130 |
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
|
| 134 |
# patch_ai_toolkit_typing()
|
| 135 |
commands = f"python run.py {os.path.join(dataset_dir, 'config.yaml')}"
|
| 136 |
process = subprocess.Popen(commands, shell=True, cwd="ai-toolkit", env=os.environ, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True,)
|