Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: bug: ModelBuilder overwrites user-provided HF_MODEL_ID for DJL Serving, preventi (5529)#5734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
228240a4badbdd22e4363ab7b3c83050387603d9f3ad0776fFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
aviruthen marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -136,7 +136,7 @@ def _build_for_torchserve(self) -> Model: | ||
| if isinstance(self.model, str): | ||
| # Configure HuggingFace model support | ||
| if not self._is_jumpstart_model_id(): | ||
| self.env_vars.update({"HF_MODEL_ID": self.model}) | ||
| self.env_vars.setdefault("HF_MODEL_ID", self.model) | ||
aviruthen marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| # Add HuggingFace token if available | ||
| if self.env_vars.get("HUGGING_FACE_HUB_TOKEN"): | ||
| @@ -212,7 +212,7 @@ def _build_for_tgi(self) -> Model: | ||
| if isinstance(self.model, str) and not self._is_jumpstart_model_id(): | ||
| # Configure HuggingFace model for TGI | ||
| self.env_vars.update({"HF_MODEL_ID": self.model}) | ||
| self.env_vars.setdefault("HF_MODEL_ID", self.model) | ||
| self.hf_model_config = _get_model_config_properties_from_hf( | ||
| self.model, self.env_vars.get("HUGGING_FACE_HUB_TOKEN") | ||
| @@ -319,9 +319,9 @@ def _build_for_djl(self) -> Model: | ||
| logger.debug(f"Using detected notebook instance type: {nb_instance}") | ||
| if isinstance(self.model, str) and not self._is_jumpstart_model_id(): | ||
| # Configure HuggingFace model for DJL (preserve user-provided HF_MODEL_ID) | ||
| # Configure HuggingFace model for DJL | ||
| self.env_vars.setdefault("HF_MODEL_ID", self.model) | ||
| # Get model configuration for DJL optimization | ||
| self.hf_model_config = _get_model_config_properties_from_hf( | ||
| self.model, self.env_vars.get("HUGGING_FACE_HUB_TOKEN") | ||
| @@ -432,7 +432,7 @@ def _build_for_triton(self) -> Model: | ||
| self.env_vars.update({"HF_TASK": model_task}) | ||
| # Configure HuggingFace authentication | ||
| self.env_vars.update({"HF_MODEL_ID": self.model}) | ||
| self.env_vars.setdefault("HF_MODEL_ID", self.model) | ||
| if self.env_vars.get("HUGGING_FACE_HUB_TOKEN"): | ||
| self.env_vars["HF_TOKEN"] = self.env_vars.get("HUGGING_FACE_HUB_TOKEN") | ||
| @@ -538,7 +538,7 @@ def _build_for_tei(self) -> Model: | ||
| if isinstance(self.model, str) and not self._is_jumpstart_model_id(): | ||
| # Configure HuggingFace model for TEI | ||
| self.env_vars.update({"HF_MODEL_ID": self.model}) | ||
| self.env_vars.setdefault("HF_MODEL_ID", self.model) | ||
| self.hf_model_config = _get_model_config_properties_from_hf( | ||
| self.model, self.env_vars.get("HUGGING_FACE_HUB_TOKEN") | ||
| @@ -682,7 +682,7 @@ def _build_for_transformers(self) -> Model: | ||
| if self.inference_spec is not None: | ||
| hf_model_id = self.inference_spec.get_model() | ||
| if isinstance(hf_model_id, str): # Only if it's a valid HF model ID | ||
| self.env_vars.update({"HF_MODEL_ID": hf_model_id}) | ||
| self.env_vars.setdefault("HF_MODEL_ID", hf_model_id) | ||
| # Get HF config only for string model IDs | ||
| if hasattr(self.env_vars, "HF_API_TOKEN"): | ||
| self.hf_model_config = _get_model_config_properties_from_hf( | ||
| @@ -701,7 +701,7 @@ def _build_for_transformers(self) -> Model: | ||
| if model_task: | ||
| self.env_vars.update({"HF_TASK": model_task}) | ||
| self.env_vars.update({"HF_MODEL_ID": self.model}) | ||
| self.env_vars.setdefault("HF_MODEL_ID", self.model) | ||
| # Add HuggingFace token if available | ||
| if self.env_vars.get("HUGGING_FACE_HUB_TOKEN"): | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.