Instructions to use zai-org/glm-4v-9b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zai-org/glm-4v-9b with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("zai-org/glm-4v-9b", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
bugfix: RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across
#9
by ZHANG886 - opened
报错原因:这是因为view()需要Tensor中的元素地址是连续的,但可能出现Tensor不连续的情况,所以先用 .contiguous()。将其在内存中变成连续分布即可。
解决方案:output = self.dense(out.transpose(1, 2).contiguous().view(B, L, -1))
ZHANG886 changed pull request status to closed