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)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ECOFRI/CXR-LLAVA-v2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload model
Browse files- CXR_LLAVA_HF.py +1 -1
CXR_LLAVA_HF.py
CHANGED
|
@@ -599,7 +599,7 @@ class CXRLLAVAModel(PreTrainedModel):
|
|
| 599 |
streamer = TextIteratorStreamer(self.tokenizer, skip_prompt=True, skip_special_tokens=True, timeout=15)
|
| 600 |
|
| 601 |
if np.array(image).max()>255:
|
| 602 |
-
raise Exception("
|
| 603 |
|
| 604 |
image = image.convert('L') # convert to grayscale
|
| 605 |
image = np.array(image)
|
|
|
|
| 599 |
streamer = TextIteratorStreamer(self.tokenizer, skip_prompt=True, skip_special_tokens=True, timeout=15)
|
| 600 |
|
| 601 |
if np.array(image).max()>255:
|
| 602 |
+
raise Exception("16-bit image is not supported.")
|
| 603 |
|
| 604 |
image = image.convert('L') # convert to grayscale
|
| 605 |
image = np.array(image)
|