Instructions to use ECOFRI/CXR-LLAVA-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ECOFRI/CXR-LLAVA-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="ECOFRI/CXR-LLAVA-v2", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ECOFRI/CXR-LLAVA-v2", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
using the model
when i run the code
from transformers import AutoModel
from PIL import Image
model = AutoModel.from_pretrained("ECOFRI/CXR-LLAVA-v2", trust_remote_code=True)
model = model.to("cuda")
cxr_image = Image.open("img.jpg")
response = model.write_radiologic_report(cxr_image)
it gives me that error :
ValueError: The model class you are passing has a config_class attribute that is not consistent with the config class you passed (model has <class 'transformers_modules.ECOFRI.CXR-LLAVA-v2.b2224786bb90d54b1e1291171866706cfbb44e2b.CXR_LLAVA_HF.CXRLLAVAConfig'> and you passed <class 'transformers_modules.ECOFRI.CXR-LLAVA-v2.b2224786bb90d54b1e1291171866706cfbb44e2b.CXR_LLAVA_HF.CXRLLAVAConfig'>. Fix one of those so they match!
and i dont know how to fix that error