We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
camp2 lmdeploy llava运行时输入高分辨率图片会返回空字符串
项目地址 https://github.com/InternLM/Tutorial/blob/camp2/lmdeploy/README.md#61-%E4%BD%BF%E7%94%A8lmdeploy%E8%BF%90%E8%A1%8C%E8%A7%86%E8%A7%89%E5%A4%9A%E6%A8%A1%E6%80%81%E5%A4%A7%E6%A8%A1%E5%9E%8Bllava
当输入一张分辨率为 1920*1080 分辨率的图片时不会返回文字 打印response时显示text为空
解决方法为手动降低分辨率
import gradio as gr from lmdeploy import pipeline # pipe = pipeline('liuhaotian/llava-v1.6-vicuna-7b') 非开发机运行此命令 pipe = pipeline('/share/new_models/liuhaotian/llava-v1.6-vicuna-7b') def model(image, text): if image is None: return [(text, "请上传一张图片。")] else: width, height = image.size print(f"width = {width}, height = {height}") # 调整图片最长宽/高为256 if max(width, height) > 256: ratio = max(width, height) / 256 n_width = int(width / ratio) n_height = int(height / ratio) print(f"new width = {n_width}, new height = {n_height}") image = image.resize((n_width, n_height)) response = pipe((text, image)).text print(f"response: {response}") return [(text, response)] demo = gr.Interface(fn=model, inputs=[gr.Image(type="pil"), gr.Textbox()], outputs=gr.Chatbot()) demo.launch()
更改后效果可以正常返回text
The text was updated successfully, but these errors were encountered:
修复了高分辨率图像llava输出为空的bug #620 (#623)
3b54212
* 增加了对llava demo回复为空的解释 * 修复了高分辨率图片llava输出为空的bug #620
No branches or pull requests
camp2 lmdeploy llava运行时输入高分辨率图片会返回空字符串
项目地址 https://github.com/InternLM/Tutorial/blob/camp2/lmdeploy/README.md#61-%E4%BD%BF%E7%94%A8lmdeploy%E8%BF%90%E8%A1%8C%E8%A7%86%E8%A7%89%E5%A4%9A%E6%A8%A1%E6%80%81%E5%A4%A7%E6%A8%A1%E5%9E%8Bllava
当输入一张分辨率为 1920*1080 分辨率的图片时不会返回文字
打印response时显示text为空
解决方法为手动降低分辨率
更改后效果可以正常返回text
The text was updated successfully, but these errors were encountered: