-
Notifications
You must be signed in to change notification settings - Fork 490
[feat] Filter out nlf model type from Upload Model flow #7793
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,8 @@ interface ModelTypeOption { | |
| value: string // Actual tag value | ||
| } | ||
|
|
||
| const DISALLOWED_MODEL_TYPES = ['nlf'] as const | ||
|
|
||
| /** | ||
| * Composable for fetching and managing model types from the API | ||
| * Uses shared state to ensure data is only fetched once | ||
|
|
@@ -51,6 +53,12 @@ export const useModelTypes = createSharedComposable(() => { | |
| async (): Promise<ModelTypeOption[]> => { | ||
| const response = await api.getModelFolders() | ||
| return response | ||
| .filter( | ||
| (folder) => | ||
| !DISALLOWED_MODEL_TYPES.includes( | ||
| folder.name as (typeof DISALLOWED_MODEL_TYPES)[number] | ||
DrJKL marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ) | ||
| ) | ||
|
Comment on lines
+56
to
+61
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Type assertion can be removed after fixing the constant declaration. The type assertion .filter(
- (folder) =>
- !DISALLOWED_MODEL_TYPES.includes(
- folder.name as (typeof DISALLOWED_MODEL_TYPES)[number]
- )
+ (folder) => !DISALLOWED_MODEL_TYPES.includes(folder.name)
)
🤖 Prompt for AI Agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd probably do a type DisallowedModelType = (typeof DISALLOWED_MODEL_TYPES)[number]to make this a little cleaner.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DrJKL That's a nice approach! Creating the If more disallowed types are added in the future, the type alias would automatically expand to the union type (e.g., 🧠 Learnings used |
||
| .map((folder) => ({ | ||
| name: formatDisplayName(folder.name), | ||
| value: folder.name | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.