@@ -69,17 +69,20 @@ class AigcModel:
6969 'main-strong' , 'character-strong'
7070 }
7171
72- def __init__ (self ,
73- aigc_type : str ,
74- base_model_type : str ,
75- model_path : str ,
76- base_model_id : str = '' ,
77- tag : Optional [str ] = 'v1.0' ,
78- description : Optional [str ] = 'this is an aigc model' ,
79- cover_images : Optional [List [str ]] = None ,
80- path_in_repo : Optional [str ] = '' ,
81- trigger_words : Optional [List [str ]] = None ,
82- official_tags : Optional [List [str ]] = None ):
72+ def __init__ (
73+ self ,
74+ aigc_type : str ,
75+ base_model_type : str ,
76+ model_path : str ,
77+ base_model_id : str = '' ,
78+ tag : Optional [str ] = 'v1.0' ,
79+ description : Optional [str ] = 'this is an aigc model' ,
80+ cover_images : Optional [List [str ]] = None ,
81+ path_in_repo : Optional [str ] = '' ,
82+ trigger_words : Optional [List [str ]] = None ,
83+ official_tags : Optional [List [str ]] = None ,
84+ model_source : Optional [str ] = 'USER_UPLOAD' ,
85+ ):
8386 """
8487 Initializes the AigcModel helper.
8588
@@ -94,12 +97,15 @@ def __init__(self,
9497 path_in_repo (str, optional): Path in the repository.
9598 trigger_words (List[str], optional): Trigger words for the AIGC Lora model.
9699 official_tags (List[str], optional): Official tags for the AIGC model. Defaults to None.
100+ model_source (str, optional): Source of the model.
101+ `USER_UPLOAD`, `TRAINED_FROM_MODELSCOPE` or `TRAINED_FROM_ALIYUN_FC`. Defaults to 'USER_UPLOAD'.
97102 """
98103 self .model_path = model_path
99104 self .aigc_type = aigc_type
100105 self .base_model_type = base_model_type
101106 self .tag = tag
102107 self .description = description
108+ self .model_source = model_source
103109 # Process cover images - convert local paths to base64 data URLs
104110 if cover_images is not None :
105111 processed_cover_images = []
@@ -383,7 +389,8 @@ def to_dict(self) -> dict:
383389 'weight_sha256' : self .weight_sha256 ,
384390 'weight_size' : self .weight_size ,
385391 'trigger_words' : self .trigger_words ,
386- 'official_tags' : self .official_tags
392+ 'official_tags' : self .official_tags ,
393+ 'model_source' : self .model_source ,
387394 }
388395
389396 @classmethod
0 commit comments