()
| 64 | }, [contentList]); |
| 65 | useEffect(() => { |
| 66 | const fetchData = async () => { |
| 67 | setLoading(true) |
| 68 | const queryParams = new URLSearchParams(search); |
| 69 | const modelSchemaId = localStorage.getItem('modelSchemaId') |
| 70 | const providerId = localStorage.getItem('providerId') |
| 71 | if (modelSchemaId && providerId) { |
| 72 | setModelSchemaId(modelSchemaId) |
| 73 | setProviderId(providerId) |
| 74 | const modelId = queryParams.get('model_id'); |
| 75 | if (modelReduxId === modelId && modelId) { |
| 76 | dispatch(setPlaygroundModelId(modelId)) |
| 77 | const allowedConfigs = JSON.parse(localStorage.getItem('allowedConfigs') as any) |
| 78 | const streaming = JSON.parse(localStorage.getItem('streaming') as any) |
| 79 | const contentModelList = JSON.parse(localStorage.getItem('modelContentList') as any) |
| 80 | setContentList(contentModelList) |
| 81 | setStreamShow(streaming) |
| 82 | setAllowedConfigs(allowedConfigs) |
| 83 | setSelectedData([modelId]) |
| 84 | setMaxTokenCheckbox(maxTokenRedux) |
| 85 | setTemperatureCheckbox(temperatureRedux) |
| 86 | setTopPCheckbox(topPValueRedux) |
| 87 | setTopKCheckbox(topKValueRedux) |
| 88 | setStopSequenceCheckbox(stopSequenceValueRedux) |
| 89 | } else if (modelId) { |
| 90 | const res = await getModelSchema(modelSchemaId) |
| 91 | setAllowedConfigs(res.data.allowed_configs || []) |
| 92 | dispatch(setPlaygroundModelId(modelId)) |
| 93 | localStorage.setItem('allowedConfigs', JSON.stringify(res.data.allowed_configs)) |
| 94 | setSelectedData([modelId]) |
| 95 | |
| 96 | const res1 = await getModelsForm(modelId) |
| 97 | |
| 98 | setStreamShow(res1.data.properties.streaming) |
| 99 | localStorage.setItem('streaming', JSON.stringify(res1.data.properties.streaming)) |
| 100 | } |
| 101 | } |
| 102 | setLoading(false) |
| 103 | } |
| 104 | fetchData() |
| 105 | }, []) |
| 106 | useEffect(() => { |
no test coverage detected