Skip to content

Commit

Permalink
refactor: removing drop classifier from network form defaulting value…
Browse files Browse the repository at this point in the history
… to false on the cli call.
  • Loading branch information
brnovasco committed May 15, 2024
1 parent 999fee9 commit 6c49ee5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
SelectTrigger,
SelectValue,
} from '~/components/ui/select';
import { Switch } from '~/components/ui/switch';
import { slurmGPUOptions, slurmPartitionOptions } from '~/lib/constants';

const slurmOptions = z.object({
Expand All @@ -43,7 +42,6 @@ export const networkSchema = z.object({
message:
'Network label name must contain only letters, numbers underscores and no spaces.',
}),
dropClassifier: z.boolean(),
jobGPUs: z.enum(['1', '2', '4']),
iterations: z.coerce.number().gte(1, { message: 'Must be >= 1' }),
learningRate: z.coerce.number().gt(0, { message: 'Must be greater than 0' }),
Expand Down Expand Up @@ -76,7 +74,6 @@ export function useNetworkForm({
defaultValues: {
networkUserLabel: networkUserLabel,
networkTypeName: networkTypeName,
dropClassifier: false,
jobGPUs: '1',
iterations: 1,
learningRate: 0.00001,
Expand Down Expand Up @@ -182,21 +179,6 @@ export function NetworkForm({
</FormItem>
)}
/>
<FormField
name="dropClassifier"
control={form.control}
render={({ field }) => (
<FormItem className="flex flex-row items-center justify-between">
<FormLabel>Drop Classifier</FormLabel>
<FormControl>
<Switch
checked={field.value}
onCheckedChange={field.onChange}
/>
</FormControl>
</FormItem>
)}
/>
<div className="flex flex-row items-center gap-1">
<FormField
name="iterations"
Expand Down
4 changes: 3 additions & 1 deletion apps/deepsirius-ui/src/server/api/routers/deepsirius-job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,9 @@ export const deepsiriusJobRouter = createTRPCRouter({
'batch-size': input.formData.batchSize,
'learning-rate': input.formData.learningRate,
optimiser: input.formData.optimizer,
'drop-classifier': input.formData.dropClassifier,
// in the ui, theres a separation of concerns between the network form and the finetune component, but the cli uses the same function for both
// so we need to pass this value as a boolean to the cli.
'drop-classifier': false,
// this is a silly way to get around the fact that the cli expects 3 values for patch size
'net-patch-size': (input.formData.patchSize + ' ').repeat(3),
};
Expand Down

0 comments on commit 6c49ee5

Please sign in to comment.