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

feat: configure HuggingfaceToken via cortex.cpp #4068

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

louis-jan
Copy link
Contributor

@louis-jan louis-jan commented Nov 21, 2024

Describe Your Changes

This press release aims to enable users to configure HuggingFace tokens to access private repositories through the cortex.cpp configuration endpoint.

This PR also resolved a legacy issue where the app incorrectly reported the GPU mode, which caused an issue when running a model with only a CPU model.

Fixes Issues

Reproduce:

  1. As a user, if I haven’t configured any Hugging Face token with access to a restricted repository, I would encounter an error when attempting to download its files.
Screenshot 2024-11-21 at 13 12 35
  1. After configuring a valid token that granted access to the repository, I was able to download the models.
Screenshot 2024-11-21 at 13 12 01

Self Checklist

The code changes introduce and manage a new setting for a Hugging Face access token within the JanModelExtension class. Here's a summary of the changes made:

  1. Enum Declaration:

    • Added a new Settings enum with a huggingfaceToken property to manage the Hugging Face access token setting.
  2. onLoad Method Update:

    • Added logic to configure the Hugging Face token on load by retrieving it from the settings using getSetting. If available, it sets the token in the cortexAPI configuration.
  3. New onSettingUpdate Method:

    • Implemented the onSettingUpdate method to handle updates to the Hugging Face access token. If this token changes, it updates the configuration in the cortexAPI accordingly.

These additions allow the extension to dynamically use and update the Hugging Face access token configuration as part of its settings.

Copy link
Contributor

github-actions bot commented Nov 21, 2024

Barecheck - Code coverage report

Total: 69.26%

Your code coverage diff: 0.00% ▴

Uncovered files and lines
FileLines
web/hooks/useSettings.ts21, 23-24, 29-31, 33-36, 38, 41, 52-58, 60-61, 63, 66, 69
web/screens/Settings/Advanced/index.tsx82, 91, 104, 122-125, 135, 139-141, 143, 191, 207-210, 217-218, 220, 224-225, 227, 229-230, 233, 280, 312-315, 321-323, 330-333, 372, 395, 404, 453, 533, 538

@louis-jan louis-jan merged commit a465da8 into dev Nov 21, 2024
9 checks passed
@louis-jan louis-jan deleted the feat/configure-huggingface-token-cortex-cpp branch November 21, 2024 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants