Upload artifact.py with huggingface_hub
Browse files- artifact.py +9 -4
artifact.py
CHANGED
@@ -111,11 +111,16 @@ class MissingArtifactTypeError(ValueError):
|
|
111 |
|
112 |
|
113 |
class Artifact(Dataclass):
|
114 |
-
type: str = Field(default=None, final=True, init=False)
|
115 |
-
|
116 |
_class_register = {}
|
117 |
|
118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
@classmethod
|
121 |
def is_artifact_dict(cls, d):
|
@@ -211,7 +216,7 @@ class Artifact(Dataclass):
|
|
211 |
def load(cls, path, artifact_identifier=None, overwrite_args=None):
|
212 |
d = artifacts_json_cache(path)
|
213 |
new_artifact = cls.from_dict(d, overwrite_args=overwrite_args)
|
214 |
-
new_artifact.
|
215 |
return new_artifact
|
216 |
|
217 |
def prepare(self):
|
|
|
111 |
|
112 |
|
113 |
class Artifact(Dataclass):
|
|
|
|
|
114 |
_class_register = {}
|
115 |
|
116 |
+
type: str = Field(default=None, final=True, init=False)
|
117 |
+
__description__: str = InternalField(
|
118 |
+
default=None, required=False, also_positional=False
|
119 |
+
)
|
120 |
+
__tags__: Dict[str, str] = InternalField(
|
121 |
+
default_factory=dict, required=False, also_positional=False
|
122 |
+
)
|
123 |
+
__id__: str = InternalField(default=None, required=False, also_positional=False)
|
124 |
|
125 |
@classmethod
|
126 |
def is_artifact_dict(cls, d):
|
|
|
216 |
def load(cls, path, artifact_identifier=None, overwrite_args=None):
|
217 |
d = artifacts_json_cache(path)
|
218 |
new_artifact = cls.from_dict(d, overwrite_args=overwrite_args)
|
219 |
+
new_artifact.__id__ = artifact_identifier
|
220 |
return new_artifact
|
221 |
|
222 |
def prepare(self):
|