fal 1.8.2__py3-none-any.whl → 1.8.4__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 fal might be problematic. Click here for more details.

fal/_fal_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '1.8.2'
16
- __version_tuple__ = version_tuple = (1, 8, 2)
15
+ __version__ = version = '1.8.4'
16
+ __version_tuple__ = version_tuple = (1, 8, 4)
fal/toolkit/file/file.py CHANGED
@@ -166,7 +166,9 @@ class File(BaseModel):
166
166
  fallback_repo = get_builtin_repository(fallback_repository)
167
167
 
168
168
  url = fallback_repo.save(
169
- fdata, object_lifecycle_preference, **fallback_save_kwargs
169
+ fdata,
170
+ object_lifecycle_preference=object_lifecycle_preference,
171
+ **fallback_save_kwargs,
170
172
  )
171
173
 
172
174
  return cls(
@@ -185,7 +185,13 @@ class FalFileRepositoryBase(FileRepository):
185
185
  @dataclass
186
186
  class FalFileRepository(FalFileRepositoryBase):
187
187
  def save(
188
- self, file: FileData, object_lifecycle_preference: dict[str, str] | None = None
188
+ self,
189
+ file: FileData,
190
+ multipart: bool | None = None,
191
+ multipart_threshold: int | None = None,
192
+ multipart_chunk_size: int | None = None,
193
+ multipart_max_concurrency: int | None = None,
194
+ object_lifecycle_preference: dict[str, str] | None = None,
189
195
  ) -> str:
190
196
  return self._save(file, "gcs")
191
197
 
@@ -414,6 +420,7 @@ class MultipartUploadV3:
414
420
  method="POST",
415
421
  headers={
416
422
  **self.auth_headers,
423
+ "Content-Type": "application/json",
417
424
  "Accept": "application/json",
418
425
  },
419
426
  data=json.dumps(
@@ -833,7 +840,10 @@ class FalFileRepositoryV2(FalFileRepositoryBase):
833
840
  content_type=content_type,
834
841
  file_name=os.path.basename(file_path),
835
842
  )
836
- url = self.save(data, object_lifecycle_preference)
843
+ url = self.save(
844
+ data,
845
+ object_lifecycle_preference=object_lifecycle_preference,
846
+ )
837
847
 
838
848
  return url, data
839
849
 
@@ -843,6 +853,10 @@ class InMemoryRepository(FileRepository):
843
853
  def save(
844
854
  self,
845
855
  file: FileData,
856
+ multipart: bool | None = None,
857
+ multipart_threshold: int | None = None,
858
+ multipart_chunk_size: int | None = None,
859
+ multipart_max_concurrency: int | None = None,
846
860
  object_lifecycle_preference: dict[str, str] | None = None,
847
861
  ) -> str:
848
862
  return f'data:{file.content_type};base64,{b64encode(file.data).decode("utf-8")}'
@@ -864,6 +878,10 @@ class FalCDNFileRepository(FileRepository):
864
878
  def save(
865
879
  self,
866
880
  file: FileData,
881
+ multipart: bool | None = None,
882
+ multipart_threshold: int | None = None,
883
+ multipart_chunk_size: int | None = None,
884
+ multipart_max_concurrency: int | None = None,
867
885
  object_lifecycle_preference: dict[str, str] | None = None,
868
886
  ) -> str:
869
887
  headers = {
@@ -1012,7 +1030,10 @@ class FalFileRepositoryV3(FileRepository):
1012
1030
  content_type=content_type,
1013
1031
  file_name=os.path.basename(file_path),
1014
1032
  )
1015
- url = self.save(data, object_lifecycle_preference)
1033
+ url = self.save(
1034
+ data,
1035
+ object_lifecycle_preference=object_lifecycle_preference,
1036
+ )
1016
1037
 
1017
1038
  return url, data
1018
1039
 
@@ -1118,6 +1139,9 @@ class InternalFalFileRepositoryV3(FileRepository):
1118
1139
  content_type=content_type,
1119
1140
  file_name=os.path.basename(file_path),
1120
1141
  )
1121
- url = self.save(data, object_lifecycle_preference)
1142
+ url = self.save(
1143
+ data,
1144
+ object_lifecycle_preference=object_lifecycle_preference,
1145
+ )
1122
1146
 
1123
1147
  return url, data
@@ -56,6 +56,10 @@ class GoogleStorageRepository(FileRepository):
56
56
  def save(
57
57
  self,
58
58
  data: FileData,
59
+ multipart: bool | None = None,
60
+ multipart_threshold: int | None = None,
61
+ multipart_chunk_size: int | None = None,
62
+ multipart_max_concurrency: int | None = None,
59
63
  object_lifecycle_preference: Optional[dict[str, str]] = None,
60
64
  ) -> str:
61
65
  destination_path = posixpath.join(
@@ -73,6 +73,10 @@ class R2Repository(FileRepository):
73
73
  def save(
74
74
  self,
75
75
  data: FileData,
76
+ multipart: bool | None = None,
77
+ multipart_threshold: int | None = None,
78
+ multipart_chunk_size: int | None = None,
79
+ multipart_max_concurrency: int | None = None,
76
80
  object_lifecycle_preference: Optional[dict[str, str]] = None,
77
81
  ) -> str:
78
82
  destination_path = posixpath.join(
@@ -57,6 +57,10 @@ class S3Repository(FileRepository):
57
57
  def save(
58
58
  self,
59
59
  data: FileData,
60
+ multipart: bool | None = None,
61
+ multipart_threshold: int | None = None,
62
+ multipart_chunk_size: int | None = None,
63
+ multipart_max_concurrency: int | None = None,
60
64
  object_lifecycle_preference: Optional[dict[str, str]] = None,
61
65
  key: Optional[str] = None,
62
66
  ) -> str:
fal/toolkit/file/types.py CHANGED
@@ -39,6 +39,10 @@ class FileRepository:
39
39
  def save(
40
40
  self,
41
41
  data: FileData,
42
+ multipart: bool | None = None,
43
+ multipart_threshold: int | None = None,
44
+ multipart_chunk_size: int | None = None,
45
+ multipart_max_concurrency: int | None = None,
42
46
  object_lifecycle_preference: Optional[dict[str, str]] = None,
43
47
  ) -> str:
44
48
  raise NotImplementedError()
@@ -59,4 +63,11 @@ class FileRepository:
59
63
  with open(file_path, "rb") as fobj:
60
64
  data = FileData(fobj.read(), content_type, Path(file_path).name)
61
65
 
62
- return self.save(data, object_lifecycle_preference), data
66
+ return self.save(
67
+ data,
68
+ multipart=multipart,
69
+ multipart_threshold=multipart_threshold,
70
+ multipart_chunk_size=multipart_chunk_size,
71
+ multipart_max_concurrency=multipart_max_concurrency,
72
+ object_lifecycle_preference=object_lifecycle_preference,
73
+ ), data
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: fal
3
- Version: 1.8.2
3
+ Version: 1.8.4
4
4
  Summary: fal is an easy-to-use Serverless Python Framework
5
5
  Author: Features & Labels <support@fal.ai>
6
6
  Requires-Python: >=3.8
@@ -1,6 +1,6 @@
1
1
  fal/__init__.py,sha256=wXs1G0gSc7ZK60-bHe-B2m0l_sA6TrFk4BxY0tMoLe8,784
2
2
  fal/__main__.py,sha256=4JMK66Wj4uLZTKbF-sT3LAxOsr6buig77PmOkJCRRxw,83
3
- fal/_fal_version.py,sha256=wyeOGWTUT7rTWqRZmS_XmHAtprBx1jO6L7FxPeYTyMM,411
3
+ fal/_fal_version.py,sha256=RzA6EmFHcrKXdLSPJdLNSA0ru2WnTYAYts_G-ig2BqQ,411
4
4
  fal/_serialization.py,sha256=rD2YiSa8iuzCaZohZwN_MPEB-PpSKbWRDeaIDpTEjyY,7653
5
5
  fal/_version.py,sha256=EBGqrknaf1WygENX-H4fBefLvHryvJBBGtVJetaB0NY,266
6
6
  fal/api.py,sha256=ZbUoe12y6sVg5-bPbzFtqHTqZoQonVDaZRjlGNaHbcs,43983
@@ -50,12 +50,12 @@ fal/toolkit/exceptions.py,sha256=elHZ7dHCJG5zlHGSBbz-ilkZe9QUvQMomJFi8Pt91LA,198
50
50
  fal/toolkit/optimize.py,sha256=p75sovF0SmRP6zxzpIaaOmqlxvXB_xEz3XPNf59EF7w,1339
51
51
  fal/toolkit/types.py,sha256=kkbOsDKj1qPGb1UARTBp7yuJ5JUuyy7XQurYUBCdti8,4064
52
52
  fal/toolkit/file/__init__.py,sha256=FbNl6wD-P0aSSTUwzHt4HujBXrbC3ABmaigPQA4hRfg,70
53
- fal/toolkit/file/file.py,sha256=ccvbWpfbvfXv11QKUEajjOze78RC7JOQDs7bZzZgPhw,9155
54
- fal/toolkit/file/types.py,sha256=MjZ6xAhKPv4rowLo2Vcbho0sX7AQ3lm3KFyYDcw0dL4,1845
55
- fal/toolkit/file/providers/fal.py,sha256=7JWTFXvAbtqakCIlA5gfKI8qU1umlWgWhvU5cXqzGVQ,36050
56
- fal/toolkit/file/providers/gcp.py,sha256=iQtkoYUqbmKKpC5srVOYtrruZ3reGRm5lz4kM8bshgk,2247
57
- fal/toolkit/file/providers/r2.py,sha256=G2OHcCH2yWrVtXT4hWHEXUeEjFhbKO0koqHcd7hkczk,2871
58
- fal/toolkit/file/providers/s3.py,sha256=CfiA6rTBFfP-empp0cB9OW2c9F5iy0Z-kGwCs5HBICU,2524
53
+ fal/toolkit/file/file.py,sha256=LyXmcHNsnBNA2MXFJ8UlHL1WHpZrOFYfwn2mfMJrdus,9216
54
+ fal/toolkit/file/types.py,sha256=MMAH_AyLOhowQPesOv1V25wB4qgbJ3vYNlnTPbdSv1M,2304
55
+ fal/toolkit/file/providers/fal.py,sha256=XH5nPwnFGklWKtecfmWeaPGUwpR4mXmvESikQ5_FBjw,36918
56
+ fal/toolkit/file/providers/gcp.py,sha256=DKeZpm1MjwbvEsYvkdXUtuLIJDr_UNbqXj_Mfv3NTeo,2437
57
+ fal/toolkit/file/providers/r2.py,sha256=YqnYkkAo_ZKIa-xoSuDnnidUFwJWHdziAR34PE6irdI,3061
58
+ fal/toolkit/file/providers/s3.py,sha256=EI45T54Mox7lHZKROss_O8o0DIn3CHP9k1iaNYVrxvg,2714
59
59
  fal/toolkit/image/__init__.py,sha256=m3OatPbBhcEOYyaTu_dgToxunUKoJu4bJVCWUoN7HX4,1838
60
60
  fal/toolkit/image/image.py,sha256=ZSkozciP4XxaGnvrR_mP4utqE3_QhoPN0dau9FJ2Xco,5033
61
61
  fal/toolkit/image/safety_checker.py,sha256=S7ow-HuoVxC6ixHWWcBrAUm2dIlgq3sTAIull6xIbAg,3105
@@ -130,8 +130,8 @@ openapi_fal_rest/models/workflow_node_type.py,sha256=-FzyeY2bxcNmizKbJI8joG7byRi
130
130
  openapi_fal_rest/models/workflow_schema.py,sha256=4K5gsv9u9pxx2ItkffoyHeNjBBYf6ur5bN4m_zePZNY,2019
131
131
  openapi_fal_rest/models/workflow_schema_input.py,sha256=2OkOXWHTNsCXHWS6EGDFzcJKkW5FIap-2gfO233EvZQ,1191
132
132
  openapi_fal_rest/models/workflow_schema_output.py,sha256=EblwSPAGfWfYVWw_WSSaBzQVju296is9o28rMBAd0mc,1196
133
- fal-1.8.2.dist-info/METADATA,sha256=l05QPJlpFqBqbK74aj6LCFFIxZbg7izsrg-LqS7ywXc,4002
134
- fal-1.8.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
135
- fal-1.8.2.dist-info/entry_points.txt,sha256=32zwTUC1U1E7nSTIGCoANQOQ3I7-qHG5wI6gsVz5pNU,37
136
- fal-1.8.2.dist-info/top_level.txt,sha256=r257X1L57oJL8_lM0tRrfGuXFwm66i1huwQygbpLmHw,21
137
- fal-1.8.2.dist-info/RECORD,,
133
+ fal-1.8.4.dist-info/METADATA,sha256=E4R9L0BkZtbTt2mB_UlXNvfWY41mhqn6RW6fxxjg_4g,4002
134
+ fal-1.8.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
135
+ fal-1.8.4.dist-info/entry_points.txt,sha256=32zwTUC1U1E7nSTIGCoANQOQ3I7-qHG5wI6gsVz5pNU,37
136
+ fal-1.8.4.dist-info/top_level.txt,sha256=r257X1L57oJL8_lM0tRrfGuXFwm66i1huwQygbpLmHw,21
137
+ fal-1.8.4.dist-info/RECORD,,
File without changes