mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-16 16:27:45 +01:00
Add base_model_sub_type for aigc model (#1563)
This commit is contained in:
@@ -129,6 +129,11 @@ class CreateCMD(CLICommand):
|
|||||||
help=
|
help=
|
||||||
'Source of the AIGC model. `USER_UPLOAD`, `TRAINED_FROM_MODELSCOPE` or `TRAINED_FROM_ALIYUN_FC`.'
|
'Source of the AIGC model. `USER_UPLOAD`, `TRAINED_FROM_MODELSCOPE` or `TRAINED_FROM_ALIYUN_FC`.'
|
||||||
)
|
)
|
||||||
|
aigc_group.add_argument(
|
||||||
|
'--base_model_sub_type',
|
||||||
|
type=str,
|
||||||
|
default='',
|
||||||
|
help='Base model sub type, e.g., Qwen_Edit_2509')
|
||||||
|
|
||||||
parser.set_defaults(func=subparser_func)
|
parser.set_defaults(func=subparser_func)
|
||||||
|
|
||||||
@@ -191,6 +196,7 @@ class CreateCMD(CLICommand):
|
|||||||
base_model_id=self.args.base_model_id,
|
base_model_id=self.args.base_model_id,
|
||||||
path_in_repo=self.args.path_in_repo,
|
path_in_repo=self.args.path_in_repo,
|
||||||
model_source=self.args.model_source,
|
model_source=self.args.model_source,
|
||||||
|
base_model_sub_type=self.args.base_model_sub_type,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Convert visibility string to int for the API call
|
# Convert visibility string to int for the API call
|
||||||
|
|||||||
@@ -305,6 +305,7 @@ class HubApi:
|
|||||||
'ModelPath': aigc_model.model_path,
|
'ModelPath': aigc_model.model_path,
|
||||||
'TriggerWords': aigc_model.trigger_words,
|
'TriggerWords': aigc_model.trigger_words,
|
||||||
'ModelSource': aigc_model.model_source,
|
'ModelSource': aigc_model.model_source,
|
||||||
|
'SubVisionFoundation': aigc_model.base_model_sub_type,
|
||||||
})
|
})
|
||||||
|
|
||||||
if aigc_model.official_tags:
|
if aigc_model.official_tags:
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ class AigcModel:
|
|||||||
trigger_words: Optional[List[str]] = None,
|
trigger_words: Optional[List[str]] = None,
|
||||||
official_tags: Optional[List[str]] = None,
|
official_tags: Optional[List[str]] = None,
|
||||||
model_source: Optional[str] = 'USER_UPLOAD',
|
model_source: Optional[str] = 'USER_UPLOAD',
|
||||||
|
base_model_sub_type: Optional[str] = '',
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
Initializes the AigcModel helper.
|
Initializes the AigcModel helper.
|
||||||
@@ -99,6 +100,7 @@ class AigcModel:
|
|||||||
official_tags (List[str], optional): Official tags for the AIGC model. Defaults to None.
|
official_tags (List[str], optional): Official tags for the AIGC model. Defaults to None.
|
||||||
model_source (str, optional): Source of the model.
|
model_source (str, optional): Source of the model.
|
||||||
`USER_UPLOAD`, `TRAINED_FROM_MODELSCOPE` or `TRAINED_FROM_ALIYUN_FC`. Defaults to 'USER_UPLOAD'.
|
`USER_UPLOAD`, `TRAINED_FROM_MODELSCOPE` or `TRAINED_FROM_ALIYUN_FC`. Defaults to 'USER_UPLOAD'.
|
||||||
|
base_model_sub_type (str, Optional): Sub vision foundation model type. Defaults to ''. e.g. `SD_1_5`
|
||||||
"""
|
"""
|
||||||
self.model_path = model_path
|
self.model_path = model_path
|
||||||
self.aigc_type = aigc_type
|
self.aigc_type = aigc_type
|
||||||
@@ -106,6 +108,7 @@ class AigcModel:
|
|||||||
self.tag = tag
|
self.tag = tag
|
||||||
self.description = description
|
self.description = description
|
||||||
self.model_source = model_source
|
self.model_source = model_source
|
||||||
|
self.base_model_sub_type = base_model_sub_type
|
||||||
# Process cover images - convert local paths to base64 data URLs
|
# Process cover images - convert local paths to base64 data URLs
|
||||||
if cover_images is not None:
|
if cover_images is not None:
|
||||||
processed_cover_images = []
|
processed_cover_images = []
|
||||||
@@ -391,6 +394,7 @@ class AigcModel:
|
|||||||
'trigger_words': self.trigger_words,
|
'trigger_words': self.trigger_words,
|
||||||
'official_tags': self.official_tags,
|
'official_tags': self.official_tags,
|
||||||
'model_source': self.model_source,
|
'model_source': self.model_source,
|
||||||
|
'base_model_sub_type': self.base_model_sub_type,
|
||||||
}
|
}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user