Spaces:
Runtime error
Runtime error
FlawedLLM
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import os
|
2 |
HF_TOKEN = os.environ["HF_TOKEN"]
|
3 |
# os.environ["BITSANDBYTES_NOWELCOME"] = "1"
|
|
|
1 |
+
import subprocess
|
2 |
+
|
3 |
+
def uninstall_and_reinstall_bitsandbytes():
|
4 |
+
try:
|
5 |
+
# Uninstall bitsandbytes
|
6 |
+
subprocess.run(["pip", "uninstall", "-y", "bitsandbytes"], check=True)
|
7 |
+
print("Uninstalled bitsandbytes successfully.")
|
8 |
+
|
9 |
+
# Reinstall bitsandbytes from the specified source
|
10 |
+
subprocess.run(["pip", "install", "-i", "https://pypi.org/simple/", "bitsandbytes"], check=True)
|
11 |
+
print("Reinstalled bitsandbytes successfully.")
|
12 |
+
except subprocess.CalledProcessError as e:
|
13 |
+
print(f"Error during uninstallation or reinstallation: {e}")
|
14 |
+
|
15 |
+
# Call the function to perform the uninstallation and reinstallation
|
16 |
+
uninstall_and_reinstall_bitsandbytes()
|
17 |
+
|
18 |
import os
|
19 |
HF_TOKEN = os.environ["HF_TOKEN"]
|
20 |
# os.environ["BITSANDBYTES_NOWELCOME"] = "1"
|