| | from huggingface_hub import hf_hub_download |
| | import os |
| | import sys |
| |
|
| | print("β¬ Downloading Roy model (IQ4_XS β optimized)...") |
| |
|
| | |
| | MODEL_FILE = "Roy-v1.IQ4_XS.gguf" |
| |
|
| | hf_hub_download( |
| | repo_id="mradermacher/Roy-v1-GGUF", |
| | filename=MODEL_FILE, |
| | local_dir="/app" |
| | ) |
| |
|
| | print("π Files in /app:") |
| | for root, dirs, files in os.walk("/app"): |
| | for f in files: |
| | print(os.path.join(root, f)) |
| |
|
| | |
| | server_path = None |
| | for root, dirs, files in os.walk("/app"): |
| | for f in files: |
| | if f in ["server", "llama-server"]: |
| | server_path = os.path.join(root, f) |
| |
|
| | if not server_path: |
| | print("β Server binary not found") |
| | sys.exit(1) |
| |
|
| | print("π Launching:", server_path) |
| |
|
| | |
| | os.execv(server_path, [ |
| | server_path, |
| | "-m", f"/app/{MODEL_FILE}", |
| |
|
| | "--host", "0.0.0.0", |
| | "--port", "7860", |
| |
|
| | |
| | "--ctx-size", "256", |
| | "--n-predict", "120", |
| | "--threads", "4", |
| | ]) |
| |
|