feat: configure HuggingfaceToken via cortex.cpp #4068
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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:Enum Declaration:
Settings
enum with ahuggingfaceToken
property to manage the Hugging Face access token setting.onLoad Method Update:
getSetting
. If available, it sets the token in thecortexAPI
configuration.New onSettingUpdate Method:
onSettingUpdate
method to handle updates to the Hugging Face access token. If this token changes, it updates the configuration in thecortexAPI
accordingly.These additions allow the extension to dynamically use and update the Hugging Face access token configuration as part of its settings.