Closed zhanghx0905 closed 2 months ago
That's the root of the problem. One simple solution is to change the name of the locally deployed glm4-v model.
zhipuAI API不支持使用 data:image/png;base64,
只能传入图像内容,所以我提了这个PR,如果你使用的是本地模型,解决方案是按照这个issue的的方案改模型名不识别,这或许可行
Has anyone successfully tested GLM-4v?
GLM-4V的API是我测试的,有遇到什么错误吗。现在可能要先 pip install GeneralAgent==0.3.19
GLM-4V的API是我测试的,有遇到什么错误吗。现在可能要先 pip install GeneralAgent==0.3.19
原来的问题和楼主一样,升级0.3.19之后问题解决了,非常感谢!
When sending requests to a locally deployed GLM4v model using Xinference, an error is encountered:
Upon investigation, it was identified that the request body construction for
openai messages
is incorrect. Theimage_url.url
field should include a format hint"data:image/png;base64,"
to properly encode the image data.Steps to Reproduce
pdf_path = "./attention_is_all_you_need.pdf" output_dir = "./attention_is_all_you_need/"
Use OPENAI_API_KEY and OPENAI_API_BASE from environment variables
content, image_paths = parse_pdf( pdf_path, output_dir=output_dir, model="glm-4v", verbose=True, api_key="KEY", base_url="URL", ) print(content) print(image_paths)