How zai-org/chatglm-6b works
ChatGLM-6B is a bilingual conversational model repository with local command-line and web demos, plus a P-Tuning v2 fine-tuning workflow. Users submit text (or, in VisualGLM demos, an image and text); the demo streams responses from a loaded model while retaining conversation history. Fine-tuning configures model and data inputs, preprocesses datasets, and delegates training and generation-based evaluation. The README documents quantized local deployment and parameter-efficient tuning. Edges reflect shown demo calls, indexed module references, or README statements; unsampled API and utility behavior is not inferred.
Main entry points: main.py Tuning entrypoint · cli_demo.py CLI chat · web_demo.py Gradio chat · web_demo2.py Streamlit chat
Components 13
Text chat demos
- CLI chat
cli_demo.py - Gradio chat
web_demo.py - Streamlit chat
web_demo2.py - Legacy Gradio
web_demo_old.py
Visual chat demos
- Vision CLI
cli_demo_vision.py - Vision Gradio
web_demo_vision.py
P-Tuning workflow
- Tuning arguments
ptuning/arguments.py - Tuning entrypoint
ptuning/main.py - Generation evaluation
ptuning/trainer_seq2seq.py - Training engine
ptuning/trainer.py - Tuning demo
ptuning/web_demo.py
Other components
- User
- Pretrained model
Connections 16
- User → CLI chat: enters prompts
cli_demo.py - CLI chat → Pretrained model: streams chat
cli_demo.py - User → Gradio chat: submits prompts
web_demo.py - Gradio chat → Pretrained model: streams chat
web_demo.py - User → Streamlit chat: submits prompts
web_demo2.py - Streamlit chat → Pretrained model: streams chat
web_demo2.py - User → Legacy Gradio: submits prompts
web_demo_old.py - Legacy Gradio → Pretrained model: streams chat
web_demo_old.py - User → Vision CLI: provides image
cli_demo_vision.py - Vision CLI → Pretrained model: streams visual chat
cli_demo_vision.py - User → Vision Gradio: uploads image
web_demo_vision.py - Vision Gradio → Pretrained model: streams visual chat
web_demo_vision.py - Tuning entrypoint → Tuning arguments: parses arguments
ptuning/main.py - Tuning entrypoint → Generation evaluation: uses evaluator
ptuning/main.py - Generation evaluation → Training engine: extends trainer
ptuning/trainer_seq2seq.py - Tuning demo → Tuning arguments: loads arguments
ptuning/web_demo.py