Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Transformerlab App
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
TransformerLab
Transformerlab App
Commits
2ceeacbf
Commit
2ceeacbf
authored
2 months ago
by
deep1401
Browse files
Options
Downloads
Patches
Plain Diff
Fix unlock model gated repo issue when HF Token is auto-detected
parent
52bfc8f0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/renderer/components/ModelZoo/ModelStore.tsx
+15
-6
15 additions, 6 deletions
src/renderer/components/ModelZoo/ModelStore.tsx
with
15 additions
and
6 deletions
src/renderer/components/ModelZoo/ModelStore.tsx
+
15
−
6
View file @
2ceeacbf
...
...
@@ -125,6 +125,8 @@ export default function ModelStore() {
{
refreshInterval
:
2000
}
);
// Creating a separate object to get useEffect for download jobs to work
// useEffect needs it to be the exact same object, not just the same values
const
obj
=
useMemo
(()
=>
({
currentlyDownloading
}),
[
currentlyDownloading
]);
...
...
@@ -134,7 +136,14 @@ export default function ModelStore() {
chatAPI
.
Endpoints
.
Config
.
Get
(
'
HuggingfaceUserAccessToken
'
),
fetcher
);
const
isHFAccessTokenSet
=
hftoken
&&
hftoken
.
length
>
0
;
const
{
data
:
canLogInToHuggingFace
}
=
useSWR
(
chatAPI
.
Endpoints
.
Models
.
HuggingFaceLogin
(),
fetcher
);
// Set isHFAccessTokenSet to true if message in canLogInToHuggingFace is 'OK'
const
isHFAccessTokenSet
=
canLogInToHuggingFace
?.
message
===
'
OK
'
;
// const isHFAccessTokenSet = hftoken && hftoken.length > 0;
// On page load, check if there are any models currently being downloaded, and if so,
// Record the jobID and model Name
...
...
@@ -413,9 +422,9 @@ export default function ModelStore() {
onClick
=
{
()
=>
{
const
confirm_result
=
confirm
(
'
To access gated Hugging Face models you must first:
\r\r
'
+
'
1. Create a READ access token in your Hugging Face account.
\r\r
'
+
'
2. Enter the token on the Transformer Lab Settings page.
\r\r
'
+
'
Click OK to go to Settings.
'
'
1. Create a READ access token in your Hugging Face account.
\r\r
'
+
'
2. Enter the token on the Transformer Lab Settings page.
\r\r
'
+
'
Click OK to go to Settings.
'
);
if
(
confirm_result
)
{
navigate
(
'
/settings
'
);
...
...
@@ -509,8 +518,8 @@ export default function ModelStore() {
{
formatBytes
(
modelDownloadProgress
?.
job_data
?.
downloaded
*
1024
*
1024
1024
*
1024
)
}
{
/* {modelDownloadProgress?.job_data} */
}
<
ArrowDownIcon
size
=
"18px"
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment