feat(studio): Reintroduce Customization creation form - #672
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (8)
💤 Files with no reviewable changes (5)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds backend-specific customization job creation, a fine-tuning form route, dataset schema and file validation, fileset selection feedback, complete-line text previews, and tests covering the new flows. ChangesCustomization job creation
Dataset validation and selection
Dataset text preview
Sequence Diagram(s)sequenceDiagram
participant User
participant NewCustomizationForm
participant DatasetValidation
participant CustomizerAPI
User->>NewCustomizationForm: select backend, model, and dataset
NewCustomizationForm->>DatasetValidation: validate fileset
DatasetValidation-->>NewCustomizationForm: return validation results
User->>NewCustomizationForm: submit fine-tuning form
NewCustomizationForm->>CustomizerAPI: create automodel or unsloth job
CustomizerAPI-->>NewCustomizationForm: return created job
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
web/packages/studio/src/util/customizerSchema.ts (1)
50-54: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMark new result/value-object interfaces
readonly. Both files introduce immutable result types that are built once and never mutated; per coding guidelines, immutable interface properties should bereadonly.
web/packages/studio/src/util/customizerSchema.ts#L50-L54: markvariant/labelonCustomizerSchemaDetectionasreadonly.web/packages/studio/src/hooks/useCustomizationDatasetValidation/index.ts#L23-L199: mark fields onFileValidationError,CompletenessError,EncodingFileError,PerFileValidation, andCustomizationDatasetValidationResultasreadonly.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/packages/studio/src/util/customizerSchema.ts` around lines 50 - 54, Mark the properties of the immutable result interfaces as readonly: update variant and label in CustomizerSchemaDetection in web/packages/studio/src/util/customizerSchema.ts (lines 50-54), and all fields in FileValidationError, CompletenessError, EncodingFileError, PerFileValidation, and CustomizationDatasetValidationResult in web/packages/studio/src/hooks/useCustomizationDatasetValidation/index.ts (lines 23-199).Source: Coding guidelines
web/packages/studio/src/components/NewCustomizationForm/LoraParametersSection.tsx (1)
218-228: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueInaccurate type assertion on
init_lora_weights.
(v as 'gaussian')mistypes any of'pissa' | 'olora' | 'loftq'as'gaussian'. Runtime value is still correct, but the assertion misrepresents the type — widen it to matchINIT_LORA_WEIGHTS_OPTIONS.As per coding guidelines: "Use type assertions sparingly. Prefer type guards and narrowing in TypeScript".
♻️ Proposed fix
- v === 'true' ? true : v === 'false' ? false : (v as 'gaussian'), + v === 'true' + ? true + : v === 'false' + ? false + : (v as 'gaussian' | 'pissa' | 'olora' | 'loftq'),🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/packages/studio/src/components/NewCustomizationForm/LoraParametersSection.tsx` around lines 218 - 228, Update the initLoraWeights onValueChange handler to narrow non-boolean values against the valid options from INIT_LORA_WEIGHTS_OPTIONS instead of asserting every value as 'gaussian'. Preserve the existing true/false handling and ensure the resulting value retains the full union of supported LoRA weight modes, including 'pissa', 'olora', and 'loftq'.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/packages/studio/src/api/datasets/useDatasetFileContent.ts`:
- Around line 99-111: Update the size-cap decision in the dataset file content
fetch flow so unknown or non-finite fileSize values are treated as capped
previews. Ensure isSizeCappedPreview causes needsRange to request bytes whenever
fileSize is null, invalid, non-finite, or exceeds FILE_PREVIEW_MAX_BYTES, while
preserving explicit range behavior.
- Around line 114-116: Update the isSizeCappedPreview branch in the dataset file
content handling to explicitly handle a capped preview with no newline, such as
when the first JSON/JSONL record exceeds 512 KB. Avoid returning the truncated
fragment directly; instead return the established truncation marker or continue
reading through the first record boundary so validateFileFormat receives valid
content.
In
`@web/packages/studio/src/components/NewCustomizationForm/ControlledJsonInput.tsx`:
- Around line 22-52: Update ControlledJsonInput to resynchronize its local text
state whenever the controller field value changes externally, using an effect
keyed to value and the same JSON.stringify formatting used during
initialization. Ensure nullish values produce an empty string and avoid changing
the existing handleChange parsing behavior.
In `@web/packages/studio/src/components/NewCustomizationForm/index.tsx`:
- Around line 120-134: Move form payload construction using
formToAutomodelCreate or formToUnslothCreate outside the try/catch in onSubmit,
then pass the prepared payload to the corresponding mutation inside the try.
Keep mutation failures swallowed for the existing onError toast behavior, while
allowing mapper errors to propagate and surface through the submit flow.
---
Nitpick comments:
In
`@web/packages/studio/src/components/NewCustomizationForm/LoraParametersSection.tsx`:
- Around line 218-228: Update the initLoraWeights onValueChange handler to
narrow non-boolean values against the valid options from
INIT_LORA_WEIGHTS_OPTIONS instead of asserting every value as 'gaussian'.
Preserve the existing true/false handling and ensure the resulting value retains
the full union of supported LoRA weight modes, including 'pissa', 'olora', and
'loftq'.
In `@web/packages/studio/src/util/customizerSchema.ts`:
- Around line 50-54: Mark the properties of the immutable result interfaces as
readonly: update variant and label in CustomizerSchemaDetection in
web/packages/studio/src/util/customizerSchema.ts (lines 50-54), and all fields
in FileValidationError, CompletenessError, EncodingFileError, PerFileValidation,
and CustomizationDatasetValidationResult in
web/packages/studio/src/hooks/useCustomizationDatasetValidation/index.ts (lines
23-199).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: c32660d9-95be-4c70-b8e7-0e766e19df0a
📒 Files selected for processing (36)
web/packages/sdk/vendored/customizer/api.tsweb/packages/sdk/vendored/customizer/schema.tsweb/packages/studio/src/api/datasets/useDatasetFileContent.tsweb/packages/studio/src/components/CustomizeModelModal/index.test.tsxweb/packages/studio/src/components/CustomizeModelModal/index.tsxweb/packages/studio/src/components/NewCustomizationForm/BackendSelectionSection.tsxweb/packages/studio/src/components/NewCustomizationForm/ComputeResourcesSection.tsxweb/packages/studio/src/components/NewCustomizationForm/ControlledJsonInput.test.tsxweb/packages/studio/src/components/NewCustomizationForm/ControlledJsonInput.tsxweb/packages/studio/src/components/NewCustomizationForm/FormSection.tsxweb/packages/studio/src/components/NewCustomizationForm/GeneralParametersSection.tsxweb/packages/studio/src/components/NewCustomizationForm/LoraParametersSection.tsxweb/packages/studio/src/components/NewCustomizationForm/ModelSelectionSection.tsxweb/packages/studio/src/components/NewCustomizationForm/TrainingMethodSection.tsxweb/packages/studio/src/components/NewCustomizationForm/index.test.tsxweb/packages/studio/src/components/NewCustomizationForm/index.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/AutoSplitNotice.test.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/AutoSplitNotice.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/ChecklistRow.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/PatternsTooltip.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/SchemaBlock.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/index.test.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/index.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/index.test.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/index.tsxweb/packages/studio/src/constants/routes.tsweb/packages/studio/src/hooks/useCustomizationDatasetValidation/encodingQuery.tsweb/packages/studio/src/hooks/useCustomizationDatasetValidation/index.test.tsxweb/packages/studio/src/hooks/useCustomizationDatasetValidation/index.tsweb/packages/studio/src/routes/NewCustomizationRoute/index.tsxweb/packages/studio/src/routes/groups/customizationRoutes.tsxweb/packages/studio/src/routes/utils.tsweb/packages/studio/src/util/customizerSchema.test.tsweb/packages/studio/src/util/customizerSchema.tsweb/packages/studio/src/util/forms/customization.test.tsweb/packages/studio/src/util/forms/customization.ts
Signed-off-by: Henrique Tolentino <htolentino@nvidia.com>
Signed-off-by: Henrique Tolentino <htolentino@nvidia.com>
Signed-off-by: Henrique Tolentino <htolentino@nvidia.com>
514d8b7 to
3db9863
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
web/packages/studio/src/routes/utils.ts (1)
346-352: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd an explicit return type to this public helper.
As per coding guidelines, exported TypeScript APIs must declare their return type.
Proposed fix
-export const getNewCustomizationJobRoute = (workspace: string, options?: { model?: string }) => { +export const getNewCustomizationJobRoute = ( + workspace: string, + options?: { model?: string } +): string => {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/packages/studio/src/routes/utils.ts` around lines 346 - 352, Update the exported getNewCustomizationJobRoute helper to declare an explicit string return type, preserving its existing base-path and encoded model-query behavior.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@web/packages/studio/src/routes/utils.ts`:
- Around line 346-352: Update the exported getNewCustomizationJobRoute helper to
declare an explicit string return type, preserving its existing base-path and
encoded model-query behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 6067a714-abb7-47cf-94c5-fe0be0636ad0
📒 Files selected for processing (36)
web/packages/sdk/vendored/customizer/api.tsweb/packages/sdk/vendored/customizer/schema.tsweb/packages/studio/src/api/datasets/useDatasetFileContent.tsweb/packages/studio/src/components/CustomizeModelModal/index.test.tsxweb/packages/studio/src/components/CustomizeModelModal/index.tsxweb/packages/studio/src/components/NewCustomizationForm/BackendSelectionSection.tsxweb/packages/studio/src/components/NewCustomizationForm/ComputeResourcesSection.tsxweb/packages/studio/src/components/NewCustomizationForm/ControlledJsonInput.test.tsxweb/packages/studio/src/components/NewCustomizationForm/ControlledJsonInput.tsxweb/packages/studio/src/components/NewCustomizationForm/FormSection.tsxweb/packages/studio/src/components/NewCustomizationForm/GeneralParametersSection.tsxweb/packages/studio/src/components/NewCustomizationForm/LoraParametersSection.tsxweb/packages/studio/src/components/NewCustomizationForm/ModelSelectionSection.tsxweb/packages/studio/src/components/NewCustomizationForm/TrainingMethodSection.tsxweb/packages/studio/src/components/NewCustomizationForm/index.test.tsxweb/packages/studio/src/components/NewCustomizationForm/index.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/AutoSplitNotice.test.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/AutoSplitNotice.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/ChecklistRow.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/PatternsTooltip.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/SchemaBlock.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/index.test.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/index.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/index.test.tsxweb/packages/studio/src/components/customizer/CustomizationFilesetSelect/index.tsxweb/packages/studio/src/constants/routes.tsweb/packages/studio/src/hooks/useCustomizationDatasetValidation/encodingQuery.tsweb/packages/studio/src/hooks/useCustomizationDatasetValidation/index.test.tsxweb/packages/studio/src/hooks/useCustomizationDatasetValidation/index.tsweb/packages/studio/src/routes/NewCustomizationRoute/index.tsxweb/packages/studio/src/routes/groups/customizationRoutes.tsxweb/packages/studio/src/routes/utils.tsweb/packages/studio/src/util/customizerSchema.test.tsweb/packages/studio/src/util/customizerSchema.tsweb/packages/studio/src/util/forms/customization.test.tsweb/packages/studio/src/util/forms/customization.ts
🚧 Files skipped from review as they are similar to previous changes (35)
- web/packages/studio/src/components/NewCustomizationForm/FormSection.tsx
- web/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/SchemaBlock.tsx
- web/packages/studio/src/constants/routes.ts
- web/packages/studio/src/components/NewCustomizationForm/ControlledJsonInput.test.tsx
- web/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/AutoSplitNotice.test.tsx
- web/packages/studio/src/components/customizer/CustomizationFilesetSelect/index.test.tsx
- web/packages/studio/src/components/NewCustomizationForm/ModelSelectionSection.tsx
- web/packages/studio/src/routes/NewCustomizationRoute/index.tsx
- web/packages/studio/src/components/NewCustomizationForm/index.test.tsx
- web/packages/studio/src/components/NewCustomizationForm/LoraParametersSection.tsx
- web/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/AutoSplitNotice.tsx
- web/packages/studio/src/routes/groups/customizationRoutes.tsx
- web/packages/studio/src/api/datasets/useDatasetFileContent.ts
- web/packages/studio/src/components/CustomizeModelModal/index.test.tsx
- web/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/ChecklistRow.tsx
- web/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/PatternsTooltip.tsx
- web/packages/studio/src/components/NewCustomizationForm/BackendSelectionSection.tsx
- web/packages/studio/src/components/NewCustomizationForm/TrainingMethodSection.tsx
- web/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/index.test.tsx
- web/packages/studio/src/hooks/useCustomizationDatasetValidation/index.test.tsx
- web/packages/studio/src/util/forms/customization.test.ts
- web/packages/studio/src/hooks/useCustomizationDatasetValidation/encodingQuery.ts
- web/packages/studio/src/components/customizer/CustomizationFilesetSelect/index.tsx
- web/packages/studio/src/util/customizerSchema.test.ts
- web/packages/sdk/vendored/customizer/api.ts
- web/packages/studio/src/util/forms/customization.ts
- web/packages/studio/src/components/customizer/CustomizationFilesetSelect/FileValidationPanel/index.tsx
- web/packages/studio/src/components/NewCustomizationForm/GeneralParametersSection.tsx
- web/packages/studio/src/components/CustomizeModelModal/index.tsx
- web/packages/studio/src/components/NewCustomizationForm/ComputeResourcesSection.tsx
- web/packages/studio/src/hooks/useCustomizationDatasetValidation/index.ts
- web/packages/studio/src/components/NewCustomizationForm/index.tsx
- web/packages/studio/src/components/NewCustomizationForm/ControlledJsonInput.tsx
- web/packages/studio/src/util/customizerSchema.ts
- web/packages/sdk/vendored/customizer/schema.ts
steramae-nvidia
left a comment
There was a problem hiding this comment.
Can you ask CC to remove a lot of the generated comments?
Signed-off-by: Henrique Tolentino <htolentino@nvidia.com>
Summary by CodeRabbit
Summary by CodeRabbit