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
91c3e5ea
Commit
91c3e5ea
authored
10 months ago
by
Tony Salomone
Browse files
Options
Downloads
Patches
Plain Diff
Add local model folder button but comment out for now.
parent
f9127eb9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/renderer/components/ModelZoo/ImportModelsModal.tsx
+41
-3
41 additions, 3 deletions
src/renderer/components/ModelZoo/ImportModelsModal.tsx
with
41 additions
and
3 deletions
src/renderer/components/ModelZoo/ImportModelsModal.tsx
+
41
−
3
View file @
91c3e5ea
...
@@ -25,6 +25,7 @@ const fetcher = (url) => fetch(url).then((res) => res.json());
...
@@ -25,6 +25,7 @@ const fetcher = (url) => fetch(url).then((res) => res.json());
export
default
function
ImportModelsModal
({
open
,
setOpen
})
{
export
default
function
ImportModelsModal
({
open
,
setOpen
})
{
const
[
importing
,
setImporting
]
=
useState
(
false
);
const
[
importing
,
setImporting
]
=
useState
(
false
);
const
[
modelFolder
,
setModelFolder
]
=
useState
(
null
);
const
{
const
{
data
:
modelsData
,
data
:
modelsData
,
...
@@ -34,7 +35,6 @@ export default function ImportModelsModal({ open, setOpen}) {
...
@@ -34,7 +35,6 @@ export default function ImportModelsModal({ open, setOpen}) {
chatAPI
.
Endpoints
.
Models
.
GetHFCacheModelList
(),
chatAPI
.
Endpoints
.
Models
.
GetHFCacheModelList
(),
fetcher
fetcher
);
);
const
models
=
modelsData
?.
data
;
const
models
=
modelsData
?.
data
;
// model_ids is an iterator
// model_ids is an iterator
...
@@ -68,7 +68,7 @@ export default function ImportModelsModal({ open, setOpen}) {
...
@@ -68,7 +68,7 @@ export default function ImportModelsModal({ open, setOpen}) {
<
Modal
open
=
{
open
}
onClose
=
{
()
=>
setOpen
(
false
)
}
>
<
Modal
open
=
{
open
}
onClose
=
{
()
=>
setOpen
(
false
)
}
>
<
ModalDialog
>
<
ModalDialog
>
<
ModalClose
/>
<
ModalClose
/>
<
Typography
level
=
"h
2
"
>
Select models to import:
</
Typography
>
<
Typography
level
=
"h
3
"
>
Select models to import:
</
Typography
>
<
form
<
form
id
=
"import-models-form"
id
=
"import-models-form"
style
=
{
{
style
=
{
{
...
@@ -90,6 +90,44 @@ export default function ImportModelsModal({ open, setOpen}) {
...
@@ -90,6 +90,44 @@ export default function ImportModelsModal({ open, setOpen}) {
}
}
}
}
>
>
{
/*
<FormControl>
<Typography>
<b>Search Local Directory: </b>
<input
type="text"
size="50"
for="modelFolderSelector"
class="btn"
value={modelFolder ? modelFolder.toString() : "(none)"}
/>
</Typography>
<input
directory=""
webkitdirectory=""
type="file"
id="modelFolderSelector"
onChange={async (event: FormEvent<HTMLFormElement>) => {
// The input returns a list of files under the selected folder.
// NOT the folder. But you can figure out the folder based on
// the difference between path and webkitRelativePath.
const filelist: FileList | null = event.target.files;
if (filelist && filelist.length > 0 ) {
const firstfile = filelist[0];
const firstfilepath = firstfile.path;
const webkitRelativePath = firstfile.webkitRelativePath;
const parentPath = firstfilepath.slice(0, -1*webkitRelativePath.length)
setModelFolder(parentPath);
} else {
setModelFolder(null);
}
}}
/>
<br />
</FormControl>
*/
}
<
Table
<
Table
aria-labelledby
=
"tableTitle"
aria-labelledby
=
"tableTitle"
stickyHeader
stickyHeader
...
@@ -171,7 +209,7 @@ export default function ImportModelsModal({ open, setOpen}) {
...
@@ -171,7 +209,7 @@ export default function ImportModelsModal({ open, setOpen}) {
justifyContent
=
"center"
justifyContent
=
"center"
margin
=
{
5
}
margin
=
{
5
}
>
>
Scanning
Hugging Face Cache
...
Scanning
for models
...
</
Typography
>
</
Typography
>
</
td
>
</
td
>
</
tr
>
</
tr
>
...
...
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