Skip to content
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

Various magic enhancements and fixes #32

Merged
merged 3 commits into from
Apr 6, 2023
Merged

Conversation

dlqqq
Copy link
Member

@dlqqq dlqqq commented Apr 6, 2023

  • Fix HF Hub provider not respecting the model_id kwarg
    • This is because weirdly enough, the repo_id attribute used by the upstream provider implementation is not resolved dynamically (i.e. self.repo_id is not accessed on model invocation); it is set statically in the constructor like so:
@root_validator()
    def validate_environment(cls, values: Dict) -> Dict:
        """Validate that api key and python package exists in environment."""
        huggingfacehub_api_token = get_from_dict_or_env(
            values, "huggingfacehub_api_token", "HUGGINGFACEHUB_API_TOKEN"
        )
        try:
            from huggingface_hub.inference_api import InferenceApi

            repo_id = values["repo_id"]
            client = InferenceApi(
                repo_id=repo_id,
                token=huggingfacehub_api_token,
                task=values.get("task"),
            )
        ...
  • Improve magics documentation
  • Add [all] optional dependency group to easily install all model provider dependencies

@dlqqq dlqqq added bug Something isn't working enhancement New feature or request labels Apr 6, 2023
@dlqqq dlqqq merged commit cf5abf8 into jupyterlab:main Apr 6, 2023
@dlqqq dlqqq deleted the misc-magics branch April 6, 2023 04:14
dbelgrod pushed a commit to dbelgrod/jupyter-ai that referenced this pull request Jun 10, 2024
* fix huggingface_hub provider

* add [all] optional dep group

* improve provider table in docs
Marchlak pushed a commit to Marchlak/jupyter-ai that referenced this pull request Oct 28, 2024
* fix huggingface_hub provider

* add [all] optional dep group

* improve provider table in docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant