Instructions to use zai-org/GLM-OCR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zai-org/GLM-OCR with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" 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("image-to-text", model="zai-org/GLM-OCR") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("zai-org/GLM-OCR") model = AutoModelForMultimodalLM.from_pretrained("zai-org/GLM-OCR", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- AMD Developer Cloud
Listed on OpenModelMap
#65 opened 24 days ago
by
duola15
Internal model structure preview
#64 opened 26 days ago
by
svetoviz
Add Real5-OmniDocBench evaluation results for GLM-OCR
#63 opened about 1 month ago
by
changdazhou
Add MDPBench private evaluation result
#61 opened 3 months ago
by
Delores-Lin
Multilingual powerhouse β testing for mobile deployment
#60 opened 3 months ago
by
3morixd
Listed on OpenModelMap
#59 opened 3 months ago
by
duola15
ValueError: Task 'image-to-text' not supported for provider 'zai-org'. Available tasks: ['conversational', 'text-to-image']
#56 opened 4 months ago
by
procioni
Please support vietnamese
#55 opened 4 months ago
by
Duonglv
Add ParseBench evaluation results
#53 opened 5 months ago
by
boyang-runllama
Inconsistent results
#50 opened 5 months ago
by
TheMrguiller
'image-to-text' not supported for provider 'zai-org'
#49 opened 5 months ago
by
BelegNeurion
instructions dont do anything is there way to actualy make it listen to it?
#48 opened 6 months ago
by
dimitarx
Retail Flyer - Constant hallucination despite prompt injection.
#47 opened 6 months ago
by
bradomni
What is the testing setup?
2
#46 opened 6 months ago
by
wamreyaz
Why does the chat template include reasoning/thinking components?
π 1
#45 opened 6 months ago
by
usrlocalben
Critical Hallucinations and Cross-Script Confusion in Multilingual Stress Test (CJK + Cyrillic)
3
#42 opened 7 months ago
by
The1Just
Easy install without transformers
π 1
#35 opened 7 months ago
by
PartyParrot
how to start with zero knowledge ?
π€ 1
1
#32 opened 7 months ago
by
JRYAN723
Table regonition doesn't work well for multiple table
5
#28 opened 7 months ago
by
OumarDicko
GLM-OCR very slow on Tesla T4 (~40s per image) even with GPU β is this expected?
4
#13 opened 7 months ago
by
905saini
Could this model extract text location or coordinate?
3
#12 opened 7 months ago
by
ExChaosen
Training data details - sources and license
π 1
#11 opened 8 months ago
by
nramrakhiyani
Requesting Example for Structured Information Extraction via cURL
π 3
2
#10 opened 8 months ago
by
andynoodles
No text output inferencing with ollama?
β 3
11
#8 opened 8 months ago
by
frankslin
GLM-OCR: A Tiny 0.9B-Parameter Model That Punches Far Above Its Weight
π€ 3
1
#7 opened 8 months ago
by
Javedalam
When will there be better support for vLLM?
6
#6 opened 8 months ago
by
Xiakj
Installation Video and Testing - Step by Step
β€οΈπ€ 5
1
#1 opened 8 months ago
by
fahdmirzac