|
61 | 61 | v-model="dataForm.model_id" |
62 | 62 | :fetch-suggestions="fetchModels" |
63 | 63 | :placeholder="t('all.pleaseInput', { value: t('endpoints.new.modelId') })" |
64 | | - @select="updateRuntimeFramework" |
| 64 | + @select="loadRequiredData" |
65 | 65 | /> |
66 | 66 | </el-form-item> |
67 | 67 | </div> |
|
153 | 153 | </p> |
154 | 154 | </el-form-item> |
155 | 155 |
|
| 156 | + <!-- runtime framework --> |
156 | 157 | <el-form-item |
157 | 158 | :label="t('endpoints.new.framework')" |
158 | 159 | class="w-full" |
|
172 | 173 | </el-select> |
173 | 174 | </el-form-item> |
174 | 175 |
|
| 176 | + <!-- quantization --> |
| 177 | + <el-form-item |
| 178 | + :label="t('endpoints.new.quantization')" |
| 179 | + class="w-full" |
| 180 | + prop="quantization"> |
| 181 | + <el-select |
| 182 | + v-model="dataForm.quantization" |
| 183 | + :placeholder=" |
| 184 | + t('all.pleaseSelect', { value: t('endpoints.new.quantization') }) |
| 185 | + " |
| 186 | + size="large" |
| 187 | + style="width: 100%"> |
| 188 | + <el-option |
| 189 | + v-for="item in availableQuantizations" |
| 190 | + :key="item.name" |
| 191 | + :label="item.name" |
| 192 | + :value="item.name" /> |
| 193 | + </el-select> |
| 194 | + </el-form-item> |
| 195 | + |
175 | 196 | <el-form-item class="w-full"> |
176 | 197 | <PublicAndPrivateRadioGroup |
177 | 198 | v-model="dataForm.visibility" |
|
221 | 242 | const endpointClusters = ref([]) |
222 | 243 | const endpointResources = ref([]) |
223 | 244 | const loading = ref(false) |
| 245 | + const availableQuantizations = ref([]) |
224 | 246 |
|
225 | 247 | const replicaRanges = [1, 2, 3, 4, 5] |
226 | 248 |
|
|
304 | 326 | }), |
305 | 327 | trigger: 'blur' |
306 | 328 | } |
| 329 | + ], |
| 330 | + quantization: [ |
| 331 | + { |
| 332 | + required: true, |
| 333 | + message: t('all.pleaseSelect', { |
| 334 | + value: t('endpoints.new.quantization') |
| 335 | + }), |
| 336 | + trigger: 'blur' |
| 337 | + } |
307 | 338 | ] |
308 | 339 | }) |
309 | 340 |
|
|
355 | 386 | } |
356 | 387 | } |
357 | 388 |
|
| 389 | + const loadRequiredData = () => { |
| 390 | + updateRuntimeFramework() |
| 391 | + fetchQuantizations() |
| 392 | + } |
| 393 | +
|
358 | 394 | const updateRuntimeFramework = async () => { |
359 | 395 | if (!dataForm.value.model_id) return |
360 | 396 | const { data, error } = await useFetchApi( |
|
437 | 473 | } |
438 | 474 | } |
439 | 475 |
|
| 476 | + const fetchQuantizations = async () => { |
| 477 | + const quantizationEndpoint = `/models/${dataForm.value.model_id}/quantizations` |
| 478 | + const { data, error } = await useFetchApi(quantizationEndpoint).json() |
| 479 | + if (data.value) { |
| 480 | + availableQuantizations.value = data.value.data |
| 481 | + } else { |
| 482 | + console.log(error.value.msg) |
| 483 | + } |
| 484 | + } |
| 485 | +
|
440 | 486 | onMounted(() => { |
441 | 487 | fetchClusters() |
442 | 488 | }) |
|
0 commit comments