Instructions to use internlm/internlm-xcomposer2-4khd-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use internlm/internlm-xcomposer2-4khd-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("visual-question-answering", model="internlm/internlm-xcomposer2-4khd-7b", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("internlm/internlm-xcomposer2-4khd-7b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
try your code snippet
#6
by yuanze1024 - opened
Great job! I'm looking for a lightweight and better substitute of Qwen-VL.
However, when I ran your code snippet here, I found two problems:
- need the environment
sentencepiece. - https://huggingface.co/internlm/internlm-xcomposer2-4khd-7b/blob/d1b74de3cac25a4fb24ec378f91bcf20df8dcc5f/README.md?code=true#L53 should be
queryinstead ofquery1.
Of course, it just bother me for a sec, but I think it may be better to correct it.