| import os |
| import sys |
| import subprocess |
| import time |
| import webbrowser |
|
|
| def print_banner(): |
| banner = """ |
| ====================================================================== |
| βββββ βββ ββ ββββββββ ββ ββββββ ββββββ βββββ ββ ββ ββ |
| ββ ββ ββββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ |
| βββββββ ββ ββ ββ ββ ββ ββ βββ ββββββ βββββββ ββββ ββ |
| ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ ββ |
| ββ ββ ββ ββββ ββ ββ ββββββ ββ ββ ββ ββ ββ ββ |
| ====================================================================== |
| INTELLIGENT LLM HUB - DISTRIBUTED TRANSFORMER FRAMEWORK |
| ====================================================================== |
| * Loaded with: Hugging Face Weights Bridge (Bi-directional) |
| * Feature suite: Autoregressive Streaming Inference & Live Sampler |
| * Training suite: Fine-tuning console + Dynamic Loss Chart |
| * Destination Hub: Host & upload directly to profile 'Aravindhan11' |
| ====================================================================== |
| """ |
| print(banner) |
|
|
| def main(): |
| print_banner() |
| |
| |
| current_dir = os.path.dirname(os.path.abspath(__file__)) |
| server_path = os.path.join(current_dir, "server.py") |
| |
| if not os.path.exists(server_path): |
| print(f"Error: Could not locate server.py in {current_dir}. Please run from the root directory.") |
| sys.exit(1) |
| |
| print("Checking dependencies...") |
| try: |
| import torch |
| import transformers |
| import datasets |
| print("-> Core dependencies (PyTorch, Transformers, Datasets) verified successfully.") |
| except ImportError as e: |
| print(f"Error: Missing core dependency. Please run 'uv sync' or install manually:\n pip install torch transformers datasets rich") |
| sys.exit(1) |
| |
| port = 8000 |
| print(f"\nStarting API Server on port {port}...") |
| |
| |
| |
| try: |
| process = subprocess.Popen( |
| [sys.executable, server_path, str(port)], |
| cwd=current_dir |
| ) |
| |
| |
| time.sleep(2) |
| |
| |
| url = f"http://localhost:{port}" |
| print(f"\n-> Launching your Web Dashboard at: {url}") |
| print("-> Press Ctrl+C in this terminal to stop the server and close the dashboard.") |
| |
| webbrowser.open(url) |
| |
| |
| process.wait() |
| |
| except KeyboardInterrupt: |
| print("\n\nShutting down Intelligent Framework Hub...") |
| try: |
| process.terminate() |
| process.wait(timeout=3) |
| except Exception: |
| pass |
| print("Server stopped. Goodbye!") |
| except Exception as e: |
| print(f"Error running the command center: {e}") |
|
|
| if __name__ == "__main__": |
| main() |
|
|