Instructions to use zai-org/glm-4-9b-chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zai-org/glm-4-9b-chat with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("zai-org/glm-4-9b-chat", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Fix: AttributeError when `input_ids` is None during multimodal LLM training
When training a multimodal language model, such as MiniGPT-4, the model utilizes inputs_embeds instead of input_ids. This is because the multimodal embeddings are aligned with the LLM's text space and are concatenated with the text embeddings, rendering input_ids unnecessary and thus None.
This leads to the following error:
AttributeError: 'NoneType' object has no attribute 'shape'
This commit addresses the issue by modifying the code to handle cases where input_ids is None, ensuring that the model can properly process the provided inputs_embeds without relying on input_ids.
For those asking about API access — I've been using Crazyrouter as a unified gateway. One API key, OpenAI SDK compatible. Works well for testing different models without managing multiple accounts.