FreedomIntelligence / HuatuoGPT-Vision-7B-hf

huggingface.co
Total runs: 785
24-hour runs: 0
7-day runs: 205
30-day runs: 112
Model's Last Updated: October 24 2024
text-generation

Introduction of HuatuoGPT-Vision-7B-hf

Model Details of HuatuoGPT-Vision-7B-hf

HuatuoGPT-Vision-7B-hf

Introduction

This is the Huggingface LLaVA version of HuatuoGPT-Vision-7B, compatible with VLLM and other frameworks. You can access the original model here: HuatuoGPT-Vision-7B .

Quick Start

1. Deploy the model using VLLM
python -m vllm.entrypoints.openai.api_server \
--model huatuogpt_vision_model_path  \
--tensor_parallel_size 1 \
--gpu_memory_utilization 0.8 \
--served-model-name huatuogpt_vision_7b \
--chat-template "{%- if messages[0]['role'] == 'system' -%}\n    {%- set system_message = messages[0]['content'] -%}\n    {%- set messages = messages[1:] -%}\n{%- else -%}\n    {% set system_message = '' -%}\n{%- endif -%}\n\n{%- for message in messages -%}\n    {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n        {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}\n    {%- endif -%}\n\n    {%- if message['role'] == 'user' -%}\n        {{ '<|user|>\n' + message['content'] + '\n' }}\n    {%- elif message['role'] == 'assistant' -%}\n        {{ '<|assistant|>\n' + message['content'] + '\n' }}\n    {%- endif -%}\n{%- endfor -%}\n\n{%- if add_generation_prompt -%}\n    {{ '<|assistant|>' }}\n{% endif %}" \
--port 9559 --max-model-len 2048 > vllm_openai_server.log 2>&1 &
2. Model inference
from openai import OpenAI
from PIL import Image
import base64
import io

def get_image(image_path):
    image = Image.open(image_path).convert('RGB')
    img_type = image.format
    if not img_type:
        img_type = image_path.split('.')[-1]
    byte_arr = io.BytesIO()
    image.save(byte_arr, format=img_type)
    byte_arr.seek(0)
    image = base64.b64encode(byte_arr.getvalue()).decode()
    return image, img_type


client = OpenAI(
    base_url="http://localhost:9559/v1",
    api_key="token-abc123"
)
image_path = 'your_image_path'
image, img_type = get_image(image_path)


inputcontent = [{
    "type": "text",
    "text": '<image>\nWhat does the picture show?'
}]

inputcontent.append({
    "type": "image_url",
    "image_url": {
        "url": f"data:image/{img_type};base64,{image}"
    }
})

response = client.chat.completions.create(
    model="huatuogpt_vision_7b",
    messages=[
        {"role": "user", "content": inputcontent}
    ],
    temperature=0.2
)
print(response.choices[0].message.content)

Citation

@misc{chen2024huatuogptvisioninjectingmedicalvisual,
      title={HuatuoGPT-Vision, Towards Injecting Medical Visual Knowledge into Multimodal LLMs at Scale}, 
      author={Junying Chen and Ruyi Ouyang and Anningzhe Gao and Shunian Chen and Guiming Hardy Chen and Xidong Wang and Ruifei Zhang and Zhenyang Cai and Ke Ji and Guangjun Yu and Xiang Wan and Benyou Wang},
      year={2024},
      eprint={2406.19280},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2406.19280}, 
}

Runs of FreedomIntelligence HuatuoGPT-Vision-7B-hf on huggingface.co

785
Total runs
0
24-hour runs
11
3-day runs
205
7-day runs
112
30-day runs

More Information About HuatuoGPT-Vision-7B-hf huggingface.co Model

More HuatuoGPT-Vision-7B-hf license Visit here:

https://choosealicense.com/licenses/apache-2.0

HuatuoGPT-Vision-7B-hf huggingface.co

HuatuoGPT-Vision-7B-hf huggingface.co is an AI model on huggingface.co that provides HuatuoGPT-Vision-7B-hf's model effect (), which can be used instantly with this FreedomIntelligence HuatuoGPT-Vision-7B-hf model. huggingface.co supports a free trial of the HuatuoGPT-Vision-7B-hf model, and also provides paid use of the HuatuoGPT-Vision-7B-hf. Support call HuatuoGPT-Vision-7B-hf model through api, including Node.js, Python, http.

FreedomIntelligence HuatuoGPT-Vision-7B-hf online free

HuatuoGPT-Vision-7B-hf huggingface.co is an online trial and call api platform, which integrates HuatuoGPT-Vision-7B-hf's modeling effects, including api services, and provides a free online trial of HuatuoGPT-Vision-7B-hf, you can try HuatuoGPT-Vision-7B-hf online for free by clicking the link below.

FreedomIntelligence HuatuoGPT-Vision-7B-hf online free url in huggingface.co:

https://huggingface.co/FreedomIntelligence/HuatuoGPT-Vision-7B-hf

HuatuoGPT-Vision-7B-hf install

HuatuoGPT-Vision-7B-hf is an open source model from GitHub that offers a free installation service, and any user can find HuatuoGPT-Vision-7B-hf on GitHub to install. At the same time, huggingface.co provides the effect of HuatuoGPT-Vision-7B-hf install, users can directly use HuatuoGPT-Vision-7B-hf installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

HuatuoGPT-Vision-7B-hf install url in huggingface.co:

https://huggingface.co/FreedomIntelligence/HuatuoGPT-Vision-7B-hf

Url of HuatuoGPT-Vision-7B-hf

Provider of HuatuoGPT-Vision-7B-hf huggingface.co

FreedomIntelligence
ORGANIZATIONS

Other API from FreedomIntelligence