together 1.3.0__tar.gz → 1.3.1__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.
- {together-1.3.0 → together-1.3.1}/PKG-INFO +1 -1
- {together-1.3.0 → together-1.3.1}/pyproject.toml +1 -1
- {together-1.3.0 → together-1.3.1}/src/together/cli/api/images.py +12 -1
- {together-1.3.0 → together-1.3.1}/src/together/types/images.py +3 -1
- {together-1.3.0 → together-1.3.1}/LICENSE +0 -0
- {together-1.3.0 → together-1.3.1}/README.md +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/__init__.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/abstract/__init__.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/abstract/api_requestor.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/cli/__init__.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/cli/api/__init__.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/cli/api/chat.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/cli/api/completions.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/cli/api/files.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/cli/api/finetune.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/cli/api/models.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/cli/api/utils.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/cli/cli.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/client.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/constants.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/error.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/filemanager.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/legacy/__init__.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/legacy/base.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/legacy/complete.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/legacy/embeddings.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/legacy/files.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/legacy/finetune.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/legacy/images.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/legacy/models.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/resources/__init__.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/resources/chat/__init__.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/resources/chat/completions.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/resources/completions.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/resources/embeddings.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/resources/files.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/resources/finetune.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/resources/images.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/resources/models.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/resources/rerank.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/together_response.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/types/__init__.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/types/abstract.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/types/chat_completions.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/types/common.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/types/completions.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/types/embeddings.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/types/error.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/types/files.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/types/finetune.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/types/models.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/types/rerank.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/utils/__init__.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/utils/_log.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/utils/api_helpers.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/utils/files.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/utils/tools.py +0 -0
- {together-1.3.0 → together-1.3.1}/src/together/version.py +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import base64
|
|
2
2
|
import pathlib
|
|
3
|
+
import requests
|
|
3
4
|
|
|
4
5
|
import click
|
|
5
6
|
from PIL import Image
|
|
@@ -70,8 +71,18 @@ def generate(
|
|
|
70
71
|
for i, choice in enumerate(response.data):
|
|
71
72
|
assert isinstance(choice, ImageChoicesData)
|
|
72
73
|
|
|
74
|
+
data = None
|
|
75
|
+
if choice.b64_json:
|
|
76
|
+
data = base64.b64decode(choice.b64_json)
|
|
77
|
+
elif choice.url:
|
|
78
|
+
data = requests.get(choice.url).content
|
|
79
|
+
|
|
80
|
+
if not data:
|
|
81
|
+
click.echo(f"Image [{i + 1}/{len(response.data)}] is empty")
|
|
82
|
+
continue
|
|
83
|
+
|
|
73
84
|
with open(f"{output}/{prefix}{choice.index}.png", "wb") as f:
|
|
74
|
-
f.write(
|
|
85
|
+
f.write(data)
|
|
75
86
|
|
|
76
87
|
click.echo(
|
|
77
88
|
f"Image [{i + 1}/{len(response.data)}] saved to {output}/{prefix}{choice.index}.png"
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|