Create a model repo — delegates to ``create_repo`` (model type). Returns the model repository URL for backward compatibility. Authentication errors are converted to ``ValueError`` by the compat layer.
(self, model_id: str, **kwargs)
| 91 | # Legacy method shims missing from LegacyHubApi |
| 92 | # ------------------------------------------------------------------ |
| 93 | def create_model(self, model_id: str, **kwargs) -> str: |
| 94 | """Create a model repo — delegates to ``create_repo`` (model type). |
| 95 | |
| 96 | Returns the model repository URL for backward compatibility. |
| 97 | Authentication errors are converted to ``ValueError`` by the compat layer. |
| 98 | """ |
| 99 | # LegacyHubApi.create_model handles exception conversion; |
| 100 | # override endpoint in the returned URL with local self.endpoint. |
| 101 | result = super().create_model(model_id, **kwargs) |
| 102 | # Replace endpoint in URL with the one resolved at __init__ time |
| 103 | if result and self.endpoint and self.endpoint not in result: |
| 104 | return f'{self.endpoint}/models/{model_id}' |
| 105 | return result |
| 106 | |
| 107 | def get_model_url(self, model_id: str) -> str: |
| 108 | """Return the model page URL ``{endpoint}/{model_id}``.""" |
no outgoing calls