Instructions to use SpringWang08/medical-vqa-dpo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use SpringWang08/medical-vqa-dpo with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("chaoyinshe/llava-med-v1.5-mistral-7b-hf") model = PeftModel.from_pretrained(base_model, "SpringWang08/medical-vqa-dpo") - Notebooks
- Google Colab
- Kaggle
File size: 655 Bytes
0045504 | 1 2 3 4 5 6 | {% for message in messages %}{% if message['role'] == 'system' %}{{ '<<SYS>>
' + message['content'][0]['text'] + '
<</SYS>>
' }}{% elif message['role'] == 'user' %}{{ '[INST] ' }}{# Render all images first #}{% for content in message['content'] | selectattr('type', 'equalto', 'image') %}{{ '<image>
' }}{% endfor %}{# Render all text next #}{% for content in message['content'] | selectattr('type', 'equalto', 'text') %}{{ content['text'] }}{% endfor %}{{' [/INST]' }}{% elif message['role'] == 'assistant' %}{{message['content'][0]['text'] + '</s>'}}{% else %}{{ raise_exception('Only user and assistant roles are supported!') }}{% endif %}{% endfor %} |