qwen2.5-VL-api / model.py
danilohssantana's picture
fixing image loading
a2b6d64
raw
history blame
705 Bytes
import requests
# curl -G "https://<uname>-<spacename>.hf.space/predict" \
# --data-urlencode "image_url=https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg" \
# --data-urlencode "prompt=Describe this image."
url = "https://danilohssantana-qwen2-5-vl-api.hf.space/predict"
# Define the parameters
params = {
"image_url": "https://cdn.britannica.com/35/238335-050-2CB2EB8A/Lionel-Messi-Argentina-Netherlands-World-Cup-Qatar-2022.jpg",
"prompt": "describe",
}
# Send the GET request
response = requests.get(url, params=params)
if response.status_code == 200:
print("Response:", response.json())
else:
print("Error:", response.status_code, response.text)