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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: inferencesh
3
- Version: 0.1.7
3
+ Version: 0.1.9
4
4
  Summary: inference.sh Python SDK
5
5
  Author: Inference Shell Inc.
6
6
  Author-email: "Inference Shell Inc." <hello@inference.sh>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "inferencesh"
7
- version = "0.1.7"
7
+ version = "0.1.9"
8
8
  description = "inference.sh Python SDK"
9
9
  authors = [
10
10
  {name = "Inference Shell Inc.", email = "hello@inference.sh"},
@@ -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
- urllib.request.urlretrieve(original_url, self._tmp_path)
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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: inferencesh
3
- Version: 0.1.7
3
+ Version: 0.1.9
4
4
  Summary: inference.sh Python SDK
5
5
  Author: Inference Shell Inc.
6
6
  Author-email: "Inference Shell Inc." <hello@inference.sh>
File without changes
File without changes
File without changes
File without changes