Skip to content

Commit cffae97

Browse files
committed
File updates
1 parent 2d40021 commit cffae97

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/inferencesh/sdk.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,12 @@ class File(BaseModel):
108108
filename: Optional[str] = None # Original filename if available
109109
_tmp_path: Optional[str] = PrivateAttr(default=None) # Internal storage for temporary file path
110110

111-
def __init__(self, **data):
112-
super().__init__(**data)
111+
model_config = ConfigDict(
112+
arbitrary_types_allowed=True,
113+
populate_by_name=True
114+
)
115+
116+
def model_post_init(self, _: Any) -> None:
113117
if self._is_url(self.uri):
114118
self._download_url()
115119
elif not os.path.isabs(self.uri):
@@ -203,8 +207,4 @@ def exists(self) -> bool:
203207

204208
def refresh_metadata(self) -> None:
205209
"""Refresh all metadata from the file."""
206-
self._populate_metadata()
207-
208-
class Config:
209-
"""Pydantic config"""
210-
arbitrary_types_allowed = True
210+
self._populate_metadata()

0 commit comments

Comments
 (0)