gen_ai_demo / app.py
Tushar-kangte's picture
Update app.py
947a25f verified
raw
history blame contribute delete
839 Bytes
from huggingface_hub import InferenceClient
client = InferenceClient(
provider="together",
api_key="tgp_v1_zZbqhs_6F4dqyaOuTsivmragw0xi5FkT-71vv7YgAIE",
)
completion = client.chat.completions.create(
model="meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
],
max_tokens=512,
)
print(completion.choices[0].message)