Skip to content

Commit

Permalink
Change the way we decide if a property is present from entrypoint con…
Browse files Browse the repository at this point in the history
…fig (#640)
  • Loading branch information
peteski22 authored Jan 15, 2025
1 parent f39e56f commit 906ed45
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lumigator/frontend/src/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,23 @@ export function retrieveEntrypoint(job) {
// See: lumigator/python/mzai/backend/backend/config_templates.py

// Normalize the max_samples
if (jsonObject?.job?.max_samples) {
if (jsonObject?.job?.max_samples !== undefined) {
jsonObject.max_samples = jsonObject.job.max_samples;
} else if (jsonObject?.evaluation?.max_samples) {
} else if (jsonObject?.evaluation?.max_samples !== undefined) {
jsonObject.max_samples = jsonObject.evaluation.max_samples;
} else {
throw new Error("Unable to parse max_samples from entrypoint config: " + configString);
}

// Normalize the model path
let modelPath = '';
if (jsonObject?.model?.path) {
if (jsonObject?.model?.path !== undefined) {
modelPath = jsonObject.model.path;
} else if (jsonObject?.model?.inference?.engine) {
} else if (jsonObject?.model?.inference?.engine !== undefined) {
modelPath = jsonObject.model.inference.engine;
} else if (jsonObject?.hf_pipeline?.model_uri) {
} else if (jsonObject?.hf_pipeline?.model_uri !== undefined) {
modelPath = jsonObject.hf_pipeline.model_uri;
} else if (jsonObject?.inference_server?.engine) {
} else if (jsonObject?.inference_server?.engine !== undefined) {
modelPath = jsonObject.inference_server.engine;
} else {
throw new Error("Unable to parse model path from entrypoint config: " + configString);
Expand Down

0 comments on commit 906ed45

Please sign in to comment.