Instructions to use openbmb/MiniCPM-V with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM-V with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "visual-question-answering" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("visual-question-answering", model="openbmb/MiniCPM-V", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("openbmb/MiniCPM-V", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update usage on Mac and GPUs do not support BF16
Browse files
README.md
CHANGED
|
@@ -138,7 +138,7 @@ model = model.to(device='cuda', dtype=torch.bfloat16)
|
|
| 138 |
#model = model.to(device='mps', dtype=torch.float16)
|
| 139 |
|
| 140 |
tokenizer = AutoTokenizer.from_pretrained('openbmb/MiniCPM-V', trust_remote_code=True)
|
| 141 |
-
model.eval()
|
| 142 |
|
| 143 |
image = Image.open('xx.jpg').convert('RGB')
|
| 144 |
question = 'What is in the image?'
|
|
@@ -167,4 +167,4 @@ Please look at [GitHub](https://github.com/OpenBMB/OmniLMM) for more detail abou
|
|
| 167 |
|
| 168 |
#### Statement
|
| 169 |
* As a LLM, MiniCPM-V generates contents by learning a large mount of texts, but it cannot comprehend, express personal opinions or make value judgement. Anything generated by MiniCPM-V does not represent the views and positions of the model developers
|
| 170 |
-
* We will not be liable for any problems arising from the use of the MinCPM-V open Source model, including but not limited to data security issues, risk of public opinion, or any risks and problems arising from the misdirection, misuse, dissemination or misuse of the model.
|
|
|
|
| 138 |
#model = model.to(device='mps', dtype=torch.float16)
|
| 139 |
|
| 140 |
tokenizer = AutoTokenizer.from_pretrained('openbmb/MiniCPM-V', trust_remote_code=True)
|
| 141 |
+
model.eval()
|
| 142 |
|
| 143 |
image = Image.open('xx.jpg').convert('RGB')
|
| 144 |
question = 'What is in the image?'
|
|
|
|
| 167 |
|
| 168 |
#### Statement
|
| 169 |
* As a LLM, MiniCPM-V generates contents by learning a large mount of texts, but it cannot comprehend, express personal opinions or make value judgement. Anything generated by MiniCPM-V does not represent the views and positions of the model developers
|
| 170 |
+
* We will not be liable for any problems arising from the use of the MinCPM-V open Source model, including but not limited to data security issues, risk of public opinion, or any risks and problems arising from the misdirection, misuse, dissemination or misuse of the model.
|