Skip to content

Commit

Permalink
Update readme with new commands
Browse files Browse the repository at this point in the history
  • Loading branch information
dudeperf3ct committed Jan 21, 2024
1 parent 4b01ed5 commit 8da2698
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions llm-finetuning/huggingface/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
To register a custom huggingface flavor run the following

```bash
zenml init
zenml stack register zencoder_hf_stack -o default -a default
zenml stack set zencoder_hf_stack
export HUGGINGFACE_USERNAME=<here>
export HUGGINGFACE_TOKEN=<here>
zenml secret create huggingface_creds --username=$HUGGINGFACE_USERNAME --token=$HUGGINGFACE_TOKEN
zenml model-deployer flavor register huggingface.hf_model_deployer_flavor.HFModelDeployerFlavor
zenml model-deployer flavor register huggingface.hf_model_deployer_flavor.HuggingFaceModelDeployerFlavor
```

Afterward, you should see the new flavor in the list of available flavors:
Expand All @@ -20,6 +21,6 @@ zenml model-deployer flavor list
Register model deployer component into the current stack

```bash
zenml model-deployer register hfendpoint --flavor=hfendpoint
zenml model-deployer register hfendpoint --flavor=hfendpoint --token=$HUGGINGFACE_TOKEN
zenml stack update zencoder_hf_stack -d hfendpoint
```
6 changes: 3 additions & 3 deletions llm-finetuning/huggingface/hf_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class HuggingFaceDeploymentConfig(ServiceConfig):
instance_type: str
region: str
vendor: str
hf_token: str
token: str
account_id: Optional[str] = None
min_replica: Optional[int] = 0
max_replica: Optional[int] = 1
Expand Down Expand Up @@ -69,7 +69,7 @@ def hf_endpoint(self) -> InferenceEndpoint:
"""
return get_inference_endpoint(
name=self.config.endpoint_name,
token=self.config.hf_token,
token=self.config.token,
namespace=self.config.namespace,
)

Expand All @@ -93,7 +93,7 @@ def provision(self) -> None:
custom_image=self.config.custom_image,
type=self.config.endpoint_type,
namespace=self.config.namespace,
token=self.config.hf_token,
token=self.config.token,
).wait(timeout=POLLING_TIMEOUT)

if self.hf_endpoint.url is not None:
Expand Down
2 changes: 1 addition & 1 deletion llm-finetuning/steps/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def deploy_model_to_hf_hub(
instance_type=instance_type,
region=region,
vendor=vendor,
hf_token=hf_token,
token=hf_token,
account_id=account_id,
min_replica=min_replica,
max_replica=max_replica,
Expand Down

0 comments on commit 8da2698

Please sign in to comment.