mirror of
https://github.com/hanzoai/engine.git
synced 2026-11-20 14:17:52 +00:00
37 lines
961 B
Python
37 lines
961 B
Python
"""
|
|
Start the server:
|
|
Dense: hanzo serve multimodal -p 1234 -m Qwen/Qwen3.5-27B
|
|
MoE: hanzo serve multimodal -p 1234 -m Qwen/Qwen3.5-35B-A3B
|
|
"""
|
|
|
|
from openai import OpenAI
|
|
|
|
client = OpenAI(api_key="foobar", base_url="http://localhost:1234/v1/")
|
|
|
|
completion = client.chat.completions.create(
|
|
model="default",
|
|
messages=[
|
|
{
|
|
"role": "user",
|
|
"content": [
|
|
{
|
|
"type": "image_url",
|
|
"image_url": {
|
|
"url": "https://www.garden-treasures.com/cdn/shop/products/IMG_6245.jpg"
|
|
},
|
|
},
|
|
{
|
|
"type": "text",
|
|
"text": "What type of flower is this? Give some fun facts.",
|
|
},
|
|
],
|
|
},
|
|
],
|
|
max_tokens=256,
|
|
frequency_penalty=1.0,
|
|
top_p=0.1,
|
|
temperature=0,
|
|
)
|
|
resp = completion.choices[0].message.content
|
|
print(resp)
|