Skip to content

Commit

Permalink
[TASK]: Use configured model in model edit (#6406)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvince2 authored and dgauldie committed Feb 5, 2025
1 parent 13f338a commit cfc4e08
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ import type { Model } from '@/types/Types';
import { OperatorStatus, WorkflowNode, WorkflowOutput } from '@/types/workflow';
import { KernelSessionManager } from '@/services/jupyter';
import { createModel, getModel } from '@/services/model';
import { getModelIdFromModelConfigurationId } from '@/services/model-configurations';
import { getAsConfiguredModel, getModelConfigurationById } from '@/services/model-configurations';
import { saveCodeToState } from '@/services/notebook';
import { logger } from '@/utils/logger';
import TeraDrilldown from '@/components/drilldown/tera-drilldown.vue';
Expand Down Expand Up @@ -356,7 +356,17 @@ onMounted(async () => {
if (input.type === 'modelId') {
inputModelId = input.value?.[0];
} else if (input.type === 'modelConfigId') {
inputModelId = await getModelIdFromModelConfigurationId(input.value?.[0]);
const modelConfigId = input.value?.[0];
const modelConfiguration = await getModelConfigurationById(modelConfigId);
const model = (await getAsConfiguredModel(modelConfigId)) as Model;
// Mark the model as originating from the config
model.temporary = true;
model.name += ` (${modelConfiguration.name})`;
model.header.name = model.name as string;
const res = await createModel(model);
if (res) {
inputModelId = res.id as string;
}
}
if (!inputModelId) return;
Expand Down

0 comments on commit cfc4e08

Please sign in to comment.