diff --git a/README.md b/README.md index 3aba6eb..a8c3595 100644 --- a/README.md +++ b/README.md @@ -65,20 +65,17 @@ For more details on the usage of these commands, refer to the [User Guide](https Example: ```python ->>> from vec_inf.api import VecInfClient ->>> client = VecInfClient() ->>> # Assume VEC_INF_ACCOUNT and VEC_INF_WORK_DIR is set ->>> response = client.launch_model("Meta-Llama-3.1-8B-Instruct") ->>> job_id = response.slurm_job_id ->>> status = client.get_status(job_id) ->>> if status.status == ModelStatus.READY: -... print(f"Model is ready at {status.base_url}") ->>> # Alternatively, use wait_until_ready which will either return a StatusResponse or throw a ServerError ->>> try: ->>> status = wait_until_ready(job_id) ->>> except ServerError as e: ->>> print(f"Model launch failed: {e}") ->>> client.shutdown_model(job_id) +ffrom vec_inf.client import VecInfClient +from vec_inf.client.models import ModelStatus + +client = VecInfClient() +# Assume VEC_INF_ACCOUNT and VEC_INF_WORK_DIR is set +response = client.launch_model("Meta-Llama-3.1-8B-Instruct") +job_id = response.slurm_job_id +status = client.get_status(job_id) +if status == ModelStatus.READY: + print(f"Model is ready at {status.base_url}") +client.shutdown_model(job_id) ``` For details on the usage of the API, refer to the [API Reference](https://vectorinstitute.github.io/vector-inference/api/) diff --git a/vec_inf/client/api.py b/vec_inf/client/api.py index 3a64415..c10fab9 100644 --- a/vec_inf/client/api.py +++ b/vec_inf/client/api.py @@ -71,7 +71,7 @@ class VecInfClient: Examples -------- - >>> from vec_inf.api import VecInfClient + >>> from vec_inf.client import VecInfClient >>> client = VecInfClient() >>> response = client.launch_model("Meta-Llama-3.1-8B-Instruct") >>> job_id = response.slurm_job_id diff --git a/venv.sh b/venv.sh index 4c77c95..72fac55 100644 --- a/venv.sh +++ b/venv.sh @@ -12,7 +12,7 @@ export UV_CACHE_DIR=/scratch/$(whoami)/uv_cache # To see if the cache directory is set correctly, run the following command # uv config get cache-dir -echo "Cache directory set to: $(uv config get cache-dir)" +echo "Cache directory set to: $(uv cache dir)" # Install dependencies via uv uv sync