-
Notifications
You must be signed in to change notification settings - Fork 78
feat(FR-1850): Add Hugging Face model import functionality with folder creation support #4945
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
base: fix_FR-1851_/reservoir-page-error
Are you sure you want to change the base?
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 4.87% (+0.96% 🔼) |
587/12051 |
| 🔴 | Branches | 4.45% (+0.42% 🔼) |
377/8466 |
| 🔴 | Functions | 2.73% (+0.5% 🔼) |
101/3694 |
| 🔴 | Lines | 4.7% (+0.97% 🔼) |
553/11770 |
Show new covered files 🐣
St.❔ |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| 🔴 | ... / ImportArtifactModelsFromHuggingFaceModal.tsx |
0% | 0% | 0% | 0% |
Test suite run success
173 tests passing in 13 suites.
Report generated by 🧪jest coverage report action from c476ea4
3c62d7a to
00abcc4
Compare
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🟡 | Statements | 63.21% (-0.29% 🔻) |
256/405 |
| 🔴 | Branches | 42.18% (-0.12% 🔻) |
151/358 |
| 🔴 | Functions | 49.46% (-0.54% 🔻) |
46/93 |
| 🟡 | Lines | 64.71% (-0.45% 🔻) |
231/357 |
Show files with reduced coverage 🔻
St.❔ |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| 🟡 | helper/index.ts | 63.09% (-0.8% 🔻) |
44.59% (-0.29% 🔻) |
55.17% (-1.97% 🔻) |
66.12% (-1.41% 🔻) |
Test suite run success
186 tests passing in 9 suites.
Report generated by 🧪jest coverage report action from c476ea4
baa2793 to
41f2b85
Compare
174cab3 to
ae20552
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a comprehensive Hugging Face model import feature, enabling users to import models with validation, project management, and folder creation capabilities. The implementation moves the import modal from the shared UI package to the main React application to support more complex business logic around model-store projects.
Key changes:
- Created
ImportArtifactModelsFromHuggingFaceModalcomponent with project validation and folder creation - Enhanced
FolderCreateModalwith URL parameter persistence using debounced synchronization - Migrated Hugging Face import component from
backend.ai-uipackage to main application for feature expansion - Added comprehensive translations across 21 languages for all import-related strings
Reviewed changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
react/src/components/ImportArtifactModelsFromHuggingFaceModal.tsx |
New modal component for Hugging Face model imports with project validation and folder creation integration |
react/src/components/FolderCreateModal.tsx |
Added URL parameter persistence with debounce, silent validation, and merged initial values from query params |
react/src/components/VFolderSelect.tsx |
Integrated form values synchronization via URL params when creating model folders |
react/src/pages/VFolderNodeListPage.tsx |
Added usage mode form value initialization when opening folder creation modal |
react/src/pages/ReservoirPage.tsx |
Updated import to use new modal component location |
react/src/components/ProjectSelect.tsx |
Changed optionFilterProp to showSearch object format for consistency |
react/src/components/MainLayout/WebUIHeader.tsx |
Updated Divider prop from type to orientation |
resources/i18n/*.json (21 files) |
Added translations for Hugging Face import modal in all supported languages |
packages/backend.ai-ui/src/locale/*.json (21 files) |
Removed old BAIImportFromHuggingFaceModal translations from shared package |
packages/backend.ai-ui/src/components/BAIImportFromHuggingFaceModal.tsx |
Deleted old component file from shared UI package |
packages/backend.ai-ui/src/components/index.ts |
Removed exports for deleted component |
react/src/components/ImportArtifactModelsFromHuggingFaceModal.tsx
Outdated
Show resolved
Hide resolved
react/src/components/ImportArtifactModelsFromHuggingFaceModal.tsx
Outdated
Show resolved
Hide resolved
nowgnuesLee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please resolve copilot review first
ae20552 to
9fb1e60
Compare
41f2b85 to
7159ab2
Compare
9fb1e60 to
325b9e6
Compare
7159ab2 to
9585139
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 51 out of 51 changed files in this pull request and generated 4 comments.
react/src/components/ImportArtifactModelsFromHuggingFaceModal.tsx
Outdated
Show resolved
Hide resolved
react/src/components/ImportArtifactModelsFromHuggingFaceModal.tsx
Outdated
Show resolved
Hide resolved
react/src/components/ImportArtifactModelsFromHuggingFaceModal.tsx
Outdated
Show resolved
Hide resolved
325b9e6 to
5e01a45
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 52 out of 52 changed files in this pull request and generated 1 comment.
react/src/components/ImportArtifactModelsFromHuggingFaceModal.tsx
Outdated
Show resolved
Hide resolved
3de9b1b to
51548af
Compare
5e01a45 to
705732f
Compare
51548af to
dc8265f
Compare
705732f to
ad64b31
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 52 out of 52 changed files in this pull request and generated 1 comment.
dc8265f to
57e307d
Compare
57e307d to
6a3b48d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 52 out of 52 changed files in this pull request and generated 3 comments.
ad64b31 to
bf4c404
Compare
6a3b48d to
34a3fd4
Compare
34a3fd4 to
10ca418
Compare
bf4c404 to
4507e03
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 52 out of 52 changed files in this pull request and generated no new comments.
…from huggingface modal
10ca418 to
c476ea4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 53 out of 53 changed files in this pull request and generated 3 comments.
| export const convertToUUID = (id: string): string => { | ||
| if (isValidUUID(id)) { | ||
| return id; | ||
| } | ||
| return id.replace( | ||
| /([0-9a-fA-F]{8})([0-9a-fA-F]{4})([0-9a-fA-F]{4})([0-9a-fA-F]{4})([0-9a-fA-F]{12})/, | ||
| '$1-$2-$3-$4-$5', | ||
| ); | ||
| }; |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convertToUUID helper function doesn't handle all edge cases properly:
- It doesn't validate that the input string has exactly 32 hexadecimal characters before attempting conversion
- If the input is neither a valid UUID nor a 32-character hex string, it returns the unchanged input, which could lead to unexpected behavior
Consider adding validation:
export const convertToUUID = (id: string): string => {
if (isValidUUID(id)) {
return id;
}
// Check if it's a 32-character hex string without hyphens
if (/^[0-9a-fA-F]{32}$/.test(id)) {
return id.replace(
/([0-9a-fA-F]{8})([0-9a-fA-F]{4})([0-9a-fA-F]{4})([0-9a-fA-F]{4})([0-9a-fA-F]{12})/,
'$1-$2-$3-$4-$5',
);
}
// Return as-is if not a recognizable format (or throw error)
return id;
};| }); | ||
| }) | ||
| .catch(() => { | ||
| return undefined; |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error handling in the .catch() block returns undefined explicitly, which is good practice for intentionally ignored errors. However, this prevents the modal from closing when validation fails. Consider whether the modal should remain open to allow users to correct validation errors, or if additional user feedback is needed when validation fails.
| return undefined; | |
| // Keep the modal open so users can correct form errors, | |
| // but provide explicit feedback instead of silently ignoring. | |
| message.error( | |
| t( | |
| 'importArtifactModelsFromHuggingFaceModal.FailedToImportModelFromHuggingFace', | |
| ), | |
| ); |
| "importArtifactModelsFromHuggingFaceModal": { | ||
| "CreateANewModelStoreStorageFolder": "Create a new model-store–exclusive folder", | ||
| "CurrentProjectChangedSuccessfully": "Current project changed successfully.", | ||
| "EnterAModelID": "Enter a model ID. (e.g. openai/gpt-oss-20b)", |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The model ID examples are inconsistent across translation files:
- English: "openai/gpt-oss-20b" (lowercase, OSS)
- Other languages: "OpenAI/GPT-SOSS-20B" (mixed case, SOSS)
For consistency and accuracy, all translations should use the same example format. The Hugging Face model ID format typically uses lowercase, so consider standardizing to "openai/gpt-oss-20b" or an actual model ID like "openai/gpt-2" across all languages.

Resolves #4926 (FR-1850)
Implement Hugging Face Model Import Feature
This PR adds a new modal for importing models from Hugging Face, allowing users to specify model ID and version. Key changes include:
ImportArtifactModelsFromHuggingFaceModalcomponent to handle Hugging Face model importsFolderCreateModalto support form state persistence in URL parametersThe implementation allows users to import models directly from Hugging Face and store them in model-specific folders, with appropriate validation and project type checking.
Caution
The folder selector will be implemented by https://lablup.atlassian.net/browse/FR-1870
Checklist: