tcmmichaelb139 commited on
Commit
fac5e5d
·
1 Parent(s): ccafeb2

fixed out of bounds issue with model num

Browse files
Files changed (1) hide show
  1. frontend/src/components/Recipe.jsx +5 -5
frontend/src/components/Recipe.jsx CHANGED
@@ -32,7 +32,7 @@ const Recipe = ({
32
  const initializeLayerRecipe = useCallback(() => {
33
  const recipe = [];
34
  for (let i = 0; i < numLayers; i++) {
35
- recipe.push([[1, 1, 0.5]]);
36
  }
37
  setLayerRecipe(recipe);
38
  }, [numLayers, setLayerRecipe]);
@@ -90,12 +90,12 @@ const Recipe = ({
90
  };
91
 
92
  const modelOptions = [
93
- { value: 1, label: "Model 1" },
94
- { value: 2, label: "Model 2" },
95
  ];
96
 
97
  const getModelName = (modelValue) => {
98
- return modelValue === 1 ? "Model 1" : "Model 2";
99
  };
100
 
101
  const getBlockId = (layerIndex, blockIndex) => {
@@ -324,7 +324,7 @@ const Recipe = ({
324
  }
325
  min={1}
326
  max={
327
- block[0] === 1
328
  ? modelLayerCounts.model1 === "N/A"
329
  ? 1
330
  : modelLayerCounts.model1
 
32
  const initializeLayerRecipe = useCallback(() => {
33
  const recipe = [];
34
  for (let i = 0; i < numLayers; i++) {
35
+ recipe.push([[0, 1, 0.5]]);
36
  }
37
  setLayerRecipe(recipe);
38
  }, [numLayers, setLayerRecipe]);
 
90
  };
91
 
92
  const modelOptions = [
93
+ { value: 0, label: "Model 1" },
94
+ { value: 1, label: "Model 2" },
95
  ];
96
 
97
  const getModelName = (modelValue) => {
98
+ return modelValue === 0 ? "Model 1" : "Model 2";
99
  };
100
 
101
  const getBlockId = (layerIndex, blockIndex) => {
 
324
  }
325
  min={1}
326
  max={
327
+ block[0] === 0
328
  ? modelLayerCounts.model1 === "N/A"
329
  ? 1
330
  : modelLayerCounts.model1