Spaces:
Running
Running
Download test/test_image.py from li2895/chatgpt2api: direct link, hf CLI and curl.
- Browser
- Download file 476 Bytes
-
https://huggingface.co/spaces/li2895/chatgpt2api/resolve/main/test/test_image.py
- Command line
-
hf download hf://spaces/li2895/chatgpt2api/test/test_image.py
-
curl -L -o test_image.py https://huggingface.co/spaces/li2895/chatgpt2api/resolve/main/test/test_image.py
476 Bytes
| from __future__ import annotations | |
| from services.protocol import openai_v1_image_generations | |
| from test.utils import save_image | |
| def main() -> None: | |
| prompt = "一只橘猫坐在窗台上,午后阳光,写实摄影" | |
| data = openai_v1_image_generations.handle({"prompt": prompt, "model": "gpt-5-3", "n": 1}) | |
| for index, item in enumerate(data["data"], start=1): | |
| print(save_image(item["b64_json"], f"image_{index}")) | |
| if __name__ == "__main__": | |
| main() | |