Download Visual-Agentic-Memory/vam/cli.py from SitongGong/gst-code-collection: direct link, hf CLI and curl.
- Browser
- Download file 923 Bytes
-
https://huggingface.co/datasets/SitongGong/gst-code-collection/resolve/main/Visual-Agentic-Memory/vam/cli.py
- Command line
-
hf download hf://datasets/SitongGong/gst-code-collection/Visual-Agentic-Memory/vam/cli.py
-
curl -L -o cli.py https://huggingface.co/datasets/SitongGong/gst-code-collection/resolve/main/Visual-Agentic-Memory/vam/cli.py
923 Bytes
| import os | |
| import asyncio | |
| from pathlib import Path | |
| def run_tui(): | |
| """Entry point for the terminal TUI.""" | |
| from vam.tui import main | |
| try: | |
| asyncio.run(main()) | |
| except KeyboardInterrupt: | |
| print("\nInterrupted.") | |
| def run_server(): | |
| """Entry point for the API server.""" | |
| import uvicorn | |
| port = int(os.environ.get("PORT", 8000)) | |
| reload_env = os.environ.get("UVICORN_RELOAD") | |
| if reload_env is not None: | |
| reload = reload_env.strip().lower() in ("1", "true", "yes", "on") | |
| else: | |
| reload = False | |
| package_root = Path(__file__).resolve().parent | |
| print(f"Starting VAM server on port {port} (reload={reload})...") | |
| uvicorn.run( | |
| "vam.server.app:app", | |
| host="0.0.0.0", | |
| port=port, | |
| log_level="info", | |
| reload=reload, | |
| reload_dirs=[str(package_root)] if reload else None, | |
| ws_max_size=1024 * 1024 * 1024 * 2 | |
| ) | |