inferencesh 0.1.7__tar.gz → 0.1.9__tar.gz
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-0.1.7/src/inferencesh.egg-info → inferencesh-0.1.9}/PKG-INFO +1 -1
- {inferencesh-0.1.7 → inferencesh-0.1.9}/pyproject.toml +1 -1
- {inferencesh-0.1.7 → inferencesh-0.1.9}/src/inferencesh/sdk.py +10 -1
- {inferencesh-0.1.7 → inferencesh-0.1.9/src/inferencesh.egg-info}/PKG-INFO +1 -1
- {inferencesh-0.1.7 → inferencesh-0.1.9}/LICENSE +0 -0
- {inferencesh-0.1.7 → inferencesh-0.1.9}/README.md +0 -0
- {inferencesh-0.1.7 → inferencesh-0.1.9}/setup.cfg +0 -0
- {inferencesh-0.1.7 → inferencesh-0.1.9}/setup.py +0 -0
- {inferencesh-0.1.7 → inferencesh-0.1.9}/src/inferencesh/__init__.py +0 -0
- {inferencesh-0.1.7 → inferencesh-0.1.9}/src/inferencesh.egg-info/SOURCES.txt +0 -0
- {inferencesh-0.1.7 → inferencesh-0.1.9}/src/inferencesh.egg-info/dependency_links.txt +0 -0
- {inferencesh-0.1.7 → inferencesh-0.1.9}/src/inferencesh.egg-info/entry_points.txt +0 -0
- {inferencesh-0.1.7 → inferencesh-0.1.9}/src/inferencesh.egg-info/requires.txt +0 -0
- {inferencesh-0.1.7 → inferencesh-0.1.9}/src/inferencesh.egg-info/top_level.txt +0 -0
- {inferencesh-0.1.7 → inferencesh-0.1.9}/tests/test_sdk.py +0 -0
|
@@ -39,6 +39,7 @@ class File(BaseModel):
|
|
|
39
39
|
def __init__(self, **data):
|
|
40
40
|
super().__init__(**data)
|
|
41
41
|
if self._is_url(self.path):
|
|
42
|
+
print(f"Downloading URL: {self.path}")
|
|
42
43
|
self._download_url()
|
|
43
44
|
elif not os.path.isabs(self.path):
|
|
44
45
|
self.path = os.path.abspath(self.path)
|
|
@@ -57,8 +58,16 @@ class File(BaseModel):
|
|
|
57
58
|
tmp_file = tempfile.NamedTemporaryFile(delete=False, suffix=suffix)
|
|
58
59
|
self._tmp_path = tmp_file.name
|
|
59
60
|
|
|
61
|
+
# Set up request with user agent
|
|
62
|
+
headers = {
|
|
63
|
+
'User-Agent': 'inference.sh'
|
|
64
|
+
}
|
|
65
|
+
req = urllib.request.Request(original_url, headers=headers)
|
|
66
|
+
|
|
60
67
|
# Download the file
|
|
61
|
-
|
|
68
|
+
print(f"Downloading URL: {original_url} to {self._tmp_path}")
|
|
69
|
+
with urllib.request.urlopen(req) as response, open(self._tmp_path, 'wb') as out_file:
|
|
70
|
+
out_file.write(response.read())
|
|
62
71
|
self.path = self._tmp_path
|
|
63
72
|
|
|
64
73
|
def __del__(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|