Spaces:
Sleeping
Sleeping
Update app.py
Browse filesremove process to install libraries and add libraries to requirements.txt
app.py
CHANGED
|
@@ -8,26 +8,13 @@ from tools.final_answer import FinalAnswerTool
|
|
| 8 |
|
| 9 |
from Gradio_UI import GradioUI
|
| 10 |
|
|
|
|
| 11 |
from sklearn.ensemble import RandomForestClassifier
|
| 12 |
from sklearn.preprocessing import LabelEncoder
|
| 13 |
|
| 14 |
import subprocess
|
| 15 |
import sys
|
| 16 |
|
| 17 |
-
def install(package):
|
| 18 |
-
# Use pip to install the package
|
| 19 |
-
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
|
| 20 |
-
|
| 21 |
-
# Install joblib
|
| 22 |
-
install("joblib")
|
| 23 |
-
|
| 24 |
-
# Verify installation
|
| 25 |
-
try:
|
| 26 |
-
import joblib
|
| 27 |
-
print(f"Successfully installed joblib version {joblib.__version__}")
|
| 28 |
-
except ImportError:
|
| 29 |
-
print("Failed to install joblib.")
|
| 30 |
-
|
| 31 |
os.getenv("HF_TOKEN")
|
| 32 |
|
| 33 |
@tool
|
|
|
|
| 8 |
|
| 9 |
from Gradio_UI import GradioUI
|
| 10 |
|
| 11 |
+
import joblib
|
| 12 |
from sklearn.ensemble import RandomForestClassifier
|
| 13 |
from sklearn.preprocessing import LabelEncoder
|
| 14 |
|
| 15 |
import subprocess
|
| 16 |
import sys
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
os.getenv("HF_TOKEN")
|
| 19 |
|
| 20 |
@tool
|