inferencesh 0.1.17__py3-none-any.whl → 0.1.18__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of inferencesh might be problematic. Click here for more details.
- inferencesh/sdk.py +11 -4
- {inferencesh-0.1.17.dist-info → inferencesh-0.1.18.dist-info}/METADATA +1 -1
- inferencesh-0.1.18.dist-info/RECORD +8 -0
- inferencesh-0.1.17.dist-info/RECORD +0 -8
- {inferencesh-0.1.17.dist-info → inferencesh-0.1.18.dist-info}/LICENSE +0 -0
- {inferencesh-0.1.17.dist-info → inferencesh-0.1.18.dist-info}/WHEEL +0 -0
- {inferencesh-0.1.17.dist-info → inferencesh-0.1.18.dist-info}/entry_points.txt +0 -0
- {inferencesh-0.1.17.dist-info → inferencesh-0.1.18.dist-info}/top_level.txt +0 -0
inferencesh/sdk.py
CHANGED
|
@@ -101,7 +101,7 @@ class BaseApp(BaseModel):
|
|
|
101
101
|
|
|
102
102
|
class File(BaseModel):
|
|
103
103
|
"""A class representing a file in the inference.sh ecosystem."""
|
|
104
|
-
uri: str # Original location (URL or file path)
|
|
104
|
+
uri: Optional[str] = None # Original location (URL or file path)
|
|
105
105
|
path: Optional[str] = None # Resolved local file path
|
|
106
106
|
content_type: Optional[str] = None # MIME type of the file
|
|
107
107
|
size: Optional[int] = None # File size in bytes
|
|
@@ -113,12 +113,19 @@ class File(BaseModel):
|
|
|
113
113
|
populate_by_name=True
|
|
114
114
|
)
|
|
115
115
|
|
|
116
|
+
@model_validator(mode='after')
|
|
117
|
+
def check_uri_or_path(self) -> 'File':
|
|
118
|
+
"""Validate that either uri or path is provided."""
|
|
119
|
+
if not self.uri and not self.path:
|
|
120
|
+
raise ValueError("Either 'uri' or 'path' must be provided")
|
|
121
|
+
return self
|
|
122
|
+
|
|
116
123
|
def model_post_init(self, _: Any) -> None:
|
|
117
|
-
if self._is_url(self.uri):
|
|
124
|
+
if self.uri and self._is_url(self.uri):
|
|
118
125
|
self._download_url()
|
|
119
|
-
elif not os.path.isabs(self.uri):
|
|
126
|
+
elif self.uri and not os.path.isabs(self.uri):
|
|
120
127
|
self.path = os.path.abspath(self.uri)
|
|
121
|
-
|
|
128
|
+
elif self.uri:
|
|
122
129
|
self.path = self.uri
|
|
123
130
|
self._populate_metadata()
|
|
124
131
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
inferencesh/__init__.py,sha256=pR0MXSJe41LgJkjGK-jhZR7LjqCFdRZtNTV6qcjYSTI,123
|
|
2
|
+
inferencesh/sdk.py,sha256=NM8_zSBW8gdIPbCK5d1iUdsgncAtbsBdG2e0MLX2hdw,8193
|
|
3
|
+
inferencesh-0.1.18.dist-info/LICENSE,sha256=OsgqEWIh2el_QMj0y8O1A5Q5Dl-dxqqYbFE6fszuR4s,1086
|
|
4
|
+
inferencesh-0.1.18.dist-info/METADATA,sha256=9lc1GISASMJmUWGahJCyZuGDupuXZBE9SbazBA1U2Ak,2590
|
|
5
|
+
inferencesh-0.1.18.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
|
6
|
+
inferencesh-0.1.18.dist-info/entry_points.txt,sha256=6IC-fyozAqW3ljsMLGCXxJ0_ui2Jb-2fLHtoH1RTnEE,45
|
|
7
|
+
inferencesh-0.1.18.dist-info/top_level.txt,sha256=TSMHg3T1ThMl1HGAWmzBClwOYH1ump5neof9BfHIwaA,12
|
|
8
|
+
inferencesh-0.1.18.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
inferencesh/__init__.py,sha256=pR0MXSJe41LgJkjGK-jhZR7LjqCFdRZtNTV6qcjYSTI,123
|
|
2
|
-
inferencesh/sdk.py,sha256=Hc7VAwIVbk0IgP2ZWplnPwHZukFaNuBNqhR92CRHsV4,7867
|
|
3
|
-
inferencesh-0.1.17.dist-info/LICENSE,sha256=OsgqEWIh2el_QMj0y8O1A5Q5Dl-dxqqYbFE6fszuR4s,1086
|
|
4
|
-
inferencesh-0.1.17.dist-info/METADATA,sha256=xtmh0tAiPy_OIP8CXcHXs2kYwdWVJTv99ZGi7GVuA3U,2590
|
|
5
|
-
inferencesh-0.1.17.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
|
6
|
-
inferencesh-0.1.17.dist-info/entry_points.txt,sha256=6IC-fyozAqW3ljsMLGCXxJ0_ui2Jb-2fLHtoH1RTnEE,45
|
|
7
|
-
inferencesh-0.1.17.dist-info/top_level.txt,sha256=TSMHg3T1ThMl1HGAWmzBClwOYH1ump5neof9BfHIwaA,12
|
|
8
|
-
inferencesh-0.1.17.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|