mplus-studio / scripts /deploy-check.py
joelsefanja's picture
Deploy Mplus Studio
d1bff6b verified
Raw
History Blame Contribute Delete
1.38 kB
from __future__ import annotations
import os
import webbrowser
TOKEN_URLS = {
"HF_TOKEN": "https://huggingface.co/settings/tokens",
"KAGGLE_API_TOKEN": "https://www.kaggle.com/settings/api",
}
REQUIRED_ENV = ["HF_TOKEN", "HF_SPACE_ID", "KAGGLE_USERNAME", "KAGGLE_API_TOKEN"]
def main() -> None:
missing = [name for name in REQUIRED_ENV if not os.environ.get(name)]
print("Mplus Studio deploy check")
print("")
for name in REQUIRED_ENV:
status = "set" if os.environ.get(name) else "missing"
print(f"{name}: {status}")
if not missing:
print("")
print("All required deploy variables are set. Run: npm run deploy:huggingface")
return
print("")
print("Missing variables:")
for name in missing:
print(f"- {name}")
for name in missing:
url = TOKEN_URLS.get(name)
if url is not None:
print(f"Opening {name} setup page: {url}")
webbrowser.open(url)
print("")
print("Set the variables in this PowerShell session, then run deploy again:")
print('$env:HF_TOKEN="hf_..."')
print('$env:HF_SPACE_ID="your-huggingface-name/mplus-studio"')
print('$env:KAGGLE_USERNAME="your-kaggle-username"')
print('$env:KAGGLE_API_TOKEN="your-kaggle-api-token"')
print("npm run deploy:huggingface")
if __name__ == "__main__":
main()