How project-baize/baize-chatbot works
Baize’s repository supports a model-building workflow: collect self-chat dialogs from question datasets, preprocess them into training JSON, fine-tune a LoRA adapter, and optionally merge that adapter into a standalone model. A separate Gradio demo serves chat using a base model and optional adapter. The graph preserves both collection versions and the released dialog datasets. Demo internals are represented at the app entry point because its source was not sampled; links based on documented behavior cite the README.
Main entry points: merge_lora.py Adapter merger · app.py Gradio chat demo · collect.py Self-chat v1 · collect_v2.py Self-chat v2
Components 17
Dialog data
- Question datasets
- Self-chat v1
collect.py - Self-chat v2
collect_v2.py - Collected dialogs
- Dialog formatter
preprocess.py - Released dialogs
data
Model training
- Training inputs
data - LoRA fine-tuning
finetune.py - LLaMA base model
Model release
- LoRA adapter
- Adapter merger
merge_lora.py - Merged model
Chat demo
- Hugging Face hub
- Gradio chat demo
demo/app.py - Loaded chat model
demo/app.py
Other components
- Project operator
- Chat user
Connections 20
- Project operator → Self-chat v1: starts collection
README.md - Project operator → Self-chat v2: starts collection
README.md - Self-chat v1 → Question datasets: loads questions
collect.py - Self-chat v2 → Question datasets: loads questions
collect_v2.py - Self-chat v1 → Collected dialogs: writes dialogs
collect.py - Self-chat v2 → Collected dialogs: writes dialogs
collect_v2.py - Collected dialogs → Dialog formatter: reads dialogs
preprocess.py - Dialog formatter → Released dialogs: writes JSON
preprocess.py - Released dialogs → Training inputs: provides examples
- Project operator → LoRA fine-tuning: starts training
README.md - LoRA fine-tuning → LLaMA base model: loads weights
finetune.py - LoRA fine-tuning → LoRA adapter: saves adapter
finetune.py - Project operator → Adapter merger: runs merge
README.md - Adapter merger → LLaMA base model: loads weights
merge_lora.py - Adapter merger → LoRA adapter: loads adapter
merge_lora.py - Adapter merger → Merged model: saves model
merge_lora.py - Chat user → Gradio chat demo: submits chat
README.md - Hugging Face hub → Gradio chat demo: provides weights
README.md - Gradio chat demo → Loaded chat model: runs inference
README.md - Loaded chat model → Gradio chat demo: returns response
README.md