mirror of
https://github.com/hanzoai/engine.git
synced 2026-11-20 14:17:52 +00:00
* Vision model loading * Progress * Works * Fix a small bug * Updated get_rope_index * Dont upcast to f32 * Dead code * Cleanup * Use sdpa in vision * optimized deepstack * UQFF support * Paged attn support * Finalize * Fix ci * Clippy
31 lines
804 B
Python
31 lines
804 B
Python
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)
|