Skip to content

Commit 21aac84

Browse files
committed
[adding test script]
1 parent 1cd4b74 commit 21aac84

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

fastchat/serve/scripts/test.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import os
2+
from litellm import image_generation
3+
4+
# Set up API keys and credentials
5+
# export OPENAI_API_KEY = "your_openai_api_key"
6+
# export VERTEX_AI_PROJECT = "your_vertex_project_id"
7+
# export VERTEX_AI_LOCATION = "us-central1"
8+
9+
prompt = "A cute baby sea otter"
10+
11+
# OpenAI
12+
13+
#response = image_generation(prompt=prompt, model="dall-e-3")
14+
15+
#print(f"response: {response.url}")
16+
17+
# Vertex AI
18+
19+
response = image_generation(
20+
prompt=prompt,
21+
model="vertex_ai/imagegeneration@006",
22+
vertex_ai_project="adroit-crow-413218",
23+
vertex_ai_location="us-central1",
24+
)
25+
26+
print(f"response: {response}")

0 commit comments

Comments
 (0)