Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,28 @@
|
|
| 1 |
# Multi-Student, Multi-Teacher Self-Improving LLM Training System with Gradio Dashboard
|
| 2 |
# Requires: transformers, datasets, matplotlib, torch, gradio, sqlalchemy, scikit-learn
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
import os
|
| 5 |
import random
|
| 6 |
import torch
|
|
|
|
| 1 |
# Multi-Student, Multi-Teacher Self-Improving LLM Training System with Gradio Dashboard
|
| 2 |
# Requires: transformers, datasets, matplotlib, torch, gradio, sqlalchemy, scikit-learn
|
| 3 |
|
| 4 |
+
import subprocess
|
| 5 |
+
import sys
|
| 6 |
+
|
| 7 |
+
def ensure_package(package_name, install_name=None):
|
| 8 |
+
try:
|
| 9 |
+
__import__(package_name)
|
| 10 |
+
except ImportError:
|
| 11 |
+
print(f"[!] Missing: {package_name} — attempting install...")
|
| 12 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", install_name or package_name])
|
| 13 |
+
|
| 14 |
+
# Ensure required packages are installed
|
| 15 |
+
for pkg in [
|
| 16 |
+
("torch", "torch"),
|
| 17 |
+
("transformers", "transformers"),
|
| 18 |
+
("datasets", "datasets"),
|
| 19 |
+
("gradio", "gradio[oauth,mcp]==5.34.0"),
|
| 20 |
+
("matplotlib", "matplotlib"),
|
| 21 |
+
("sklearn", "scikit-learn"),
|
| 22 |
+
("sqlite3", None), # built-in, skip install
|
| 23 |
+
]:
|
| 24 |
+
ensure_package(pkg[0], pkg[1])
|
| 25 |
+
|
| 26 |
import os
|
| 27 |
import random
|
| 28 |
import torch
|