fix: model_name reference in Model Manager (#3756)

This commit is contained in:
blessedcoolant 2023-07-14 05:58:35 +12:00 committed by GitHub
commit 271f64068c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 9 deletions

View File

@ -46,7 +46,7 @@ export default function CheckpointModelEdit(props: CheckpointModelEditProps) {
const checkpointEditForm = useForm({ const checkpointEditForm = useForm({
initialValues: { initialValues: {
name: retrievedModel.name, name: retrievedModel.model_name,
base_model: retrievedModel.base_model, base_model: retrievedModel.base_model,
type: 'main', type: 'main',
path: retrievedModel.path, path: retrievedModel.path,
@ -67,7 +67,7 @@ export default function CheckpointModelEdit(props: CheckpointModelEditProps) {
<Flex justifyContent="space-between" alignItems="center"> <Flex justifyContent="space-between" alignItems="center">
<Flex flexDirection="column"> <Flex flexDirection="column">
<Text fontSize="lg" fontWeight="bold"> <Text fontSize="lg" fontWeight="bold">
{retrievedModel.name} {retrievedModel.model_name}
</Text> </Text>
<Text fontSize="sm" color="base.400"> <Text fontSize="sm" color="base.400">
{MODEL_TYPE_MAP[retrievedModel.base_model]} Model {MODEL_TYPE_MAP[retrievedModel.base_model]} Model

View File

@ -44,7 +44,7 @@ export default function DiffusersModelEdit(props: DiffusersModelEditProps) {
const diffusersEditForm = useForm({ const diffusersEditForm = useForm({
initialValues: { initialValues: {
name: retrievedModel.name, name: retrievedModel.model_name,
base_model: retrievedModel.base_model, base_model: retrievedModel.base_model,
type: 'main', type: 'main',
path: retrievedModel.path, path: retrievedModel.path,
@ -63,7 +63,7 @@ export default function DiffusersModelEdit(props: DiffusersModelEditProps) {
<Flex flexDirection="column" rowGap={4} width="100%"> <Flex flexDirection="column" rowGap={4} width="100%">
<Flex flexDirection="column"> <Flex flexDirection="column">
<Text fontSize="lg" fontWeight="bold"> <Text fontSize="lg" fontWeight="bold">
{retrievedModel.name} {retrievedModel.model_name}
</Text> </Text>
<Text fontSize="sm" color="base.400"> <Text fontSize="sm" color="base.400">
{MODEL_TYPE_MAP[retrievedModel.base_model]} Model {MODEL_TYPE_MAP[retrievedModel.base_model]} Model

View File

@ -74,13 +74,15 @@ const ModelList = () => {
Object.keys(modelList).forEach((model, i) => { Object.keys(modelList).forEach((model, i) => {
if ( if (
modelList[model].name.toLowerCase().includes(searchText.toLowerCase()) modelList[model]?.model_name
.toLowerCase()
.includes(searchText.toLowerCase())
) { ) {
filteredModelListItemsToRender.push( filteredModelListItemsToRender.push(
<ModelListItem <ModelListItem
key={i} key={i}
modelKey={model} modelKey={model}
name={modelList[model].name} name={modelList[model]?.model_name}
description={modelList[model].description} description={modelList[model].description}
/> />
); );
@ -89,7 +91,7 @@ const ModelList = () => {
<ModelListItem <ModelListItem
key={i} key={i}
modelKey={model} modelKey={model}
name={modelList[model].name} name={modelList[model]?.model_name}
description={modelList[model].description} description={modelList[model].description}
/> />
); );
@ -100,7 +102,7 @@ const ModelList = () => {
<ModelListItem <ModelListItem
key={i} key={i}
modelKey={model} modelKey={model}
name={modelList[model].name} name={modelList[model]?.model_name}
description={modelList[model].description} description={modelList[model].description}
/> />
); );
@ -109,7 +111,7 @@ const ModelList = () => {
<ModelListItem <ModelListItem
key={i} key={i}
modelKey={model} modelKey={model}
name={modelList[model].name} name={modelList[model]?.model_name}
description={modelList[model].description} description={modelList[model].description}
/> />
); );