Spaces:
Runtime error
Runtime error
FlawedLLM
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,24 +1,24 @@
|
|
1 |
|
2 |
# from huggingface_hub import login, HfFolder
|
3 |
import subprocess
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
subprocess.run(["pip", "install", "--upgrade", "pip"], check=True)
|
6 |
subprocess.run(["pip", "install", "--upgrade", "torch"], check=True)
|
7 |
# subprocess.run(["pip", "install", "--upgrade", "transformers"], check=True)
|
8 |
-
|
9 |
# subprocess.run(["pip", "install", "--upgrade", "peft"], check=True)
|
10 |
subprocess.run(["pip", "install", "--upgrade", "xformers"], check=True)
|
11 |
# subprocess.run(["pip", "install", "--upgrade", "accelerate"], check=True)
|
12 |
subprocess.run(["pip", "install", "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"], check=True)
|
13 |
-
import subprocess
|
|
|
14 |
|
15 |
-
# def run_command(cmd, shell=False):
|
16 |
-
# """Runs a shell command and prints the output."""
|
17 |
-
# try:
|
18 |
-
# result = subprocess.run(cmd, shell=shell, capture_output=True, text=True, check=True)
|
19 |
-
# print(result.stdout)
|
20 |
-
# except subprocess.CalledProcessError as e:
|
21 |
-
# print(f"Error executing command: {e.stderr}")
|
22 |
|
23 |
# # 1. Create the conda environment
|
24 |
# run_command(["conda", "create", "-y", "--name", "unsloth_env", "python=3.10"])
|
|
|
1 |
|
2 |
# from huggingface_hub import login, HfFolder
|
3 |
import subprocess
|
4 |
+
def run_command(cmd, shell=False):
|
5 |
+
"""Runs a shell command and prints the output."""
|
6 |
+
try:
|
7 |
+
result = subprocess.run(cmd, shell=shell, capture_output=True, text=True, check=True)
|
8 |
+
print(result.stdout)
|
9 |
+
except subprocess.CalledProcessError as e:
|
10 |
+
print(f"Error executing command: {e.stderr}")
|
11 |
subprocess.run(["pip", "install", "--upgrade", "pip"], check=True)
|
12 |
subprocess.run(["pip", "install", "--upgrade", "torch"], check=True)
|
13 |
# subprocess.run(["pip", "install", "--upgrade", "transformers"], check=True)
|
14 |
+
run_command(["pip", "install", "--no-deps", "trl", "peft", "accelerate", "bitsandbytes"])
|
15 |
# subprocess.run(["pip", "install", "--upgrade", "peft"], check=True)
|
16 |
subprocess.run(["pip", "install", "--upgrade", "xformers"], check=True)
|
17 |
# subprocess.run(["pip", "install", "--upgrade", "accelerate"], check=True)
|
18 |
subprocess.run(["pip", "install", "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"], check=True)
|
19 |
+
# import subprocess
|
20 |
+
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
# # 1. Create the conda environment
|
24 |
# run_command(["conda", "create", "-y", "--name", "unsloth_env", "python=3.10"])
|