File size: 2,058 Bytes
239d4ec | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | #!/usr/bin/env python3
import os
import sys
from huggingface_hub import HfApi, login
def deploy():
print("[*] Initiating Ferrell Synthetic Intelligence Hugging Face Deployment Sequence...")
token = input("Enter your Hugging Face Write Access Token: ").strip()
if not token:
print("[-] Absolute token signature required. Deployment aborted.")
sys.exit(1)
repo_id = input("Enter target Repository ID (e.g., 'your-username/vitalis-core'): ").strip()
if not repo_id:
print("[-] Target repository layout specification mismatch.")
sys.exit(1)
try:
login(token=token)
api = HfApi()
print(f"[*] Creating repository context mapping for: {repo_id}")
api.create_repo(repo_id=repo_id, repo_type="model", exist_ok=True)
print("[*] Uploading core architecture tree structures safely to Hugging Face...")
target_paths = ["core", "src", "extensions", "app.py", "run_vitalis.py", "requirements.txt", "README.md"]
for item in target_paths:
local_path = os.path.expanduser(f"~/vitalis_core/{item}")
if os.path.exists(local_path):
print(f"[+] Syncing item: {item}")
if os.path.isdir(local_path):
api.upload_folder(
folder_path=local_path,
path_in_repo=item,
repo_id=repo_id,
repo_type="model"
)
else:
api.upload_file(
path_or_fileobj=local_path,
path_in_repo=item,
repo_id=repo_id,
repo_type="model"
)
print(f"\n[+] Production Deployment Complete. Model package accessible at: https://huggingface.co/{repo_id}")
except Exception as e:
print(f"[-] Critical failure during asset transmission: {e}")
if __name__ == "__main__":
deploy()
|