inferencesh 0.1.8__tar.gz → 0.1.10__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.8
3
+ Version: 0.1.10
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.8"
7
+ version = "0.1.10"
8
8
  description = "inference.sh Python SDK"
9
9
  authors = [
10
10
  {name = "Inference Shell Inc.", email = "hello@inference.sh"},
@@ -39,7 +39,6 @@ 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}")
43
42
  self._download_url()
44
43
  elif not os.path.isabs(self.path):
45
44
  self.path = os.path.abspath(self.path)
@@ -58,9 +57,20 @@ class File(BaseModel):
58
57
  tmp_file = tempfile.NamedTemporaryFile(delete=False, suffix=suffix)
59
58
  self._tmp_path = tmp_file.name
60
59
 
60
+ # Set up request with user agent
61
+ headers = {
62
+ 'User-Agent': (
63
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) '
64
+ 'AppleWebKit/537.36 (KHTML, like Gecko) '
65
+ 'Chrome/91.0.4472.124 Safari/537.36'
66
+ )
67
+ }
68
+ req = urllib.request.Request(original_url, headers=headers)
69
+
61
70
  # Download the file
62
71
  print(f"Downloading URL: {original_url} to {self._tmp_path}")
63
- urllib.request.urlretrieve(original_url, self._tmp_path)
72
+ with urllib.request.urlopen(req) as response, open(self._tmp_path, 'wb') as out_file:
73
+ out_file.write(response.read())
64
74
  self.path = self._tmp_path
65
75
 
66
76
  def __del__(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: inferencesh
3
- Version: 0.1.8
3
+ Version: 0.1.10
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