Get help text based on current language.
(key: str)
| 26 | |
| 27 | |
| 28 | def _get_help(key: str) -> str: |
| 29 | """Get help text based on current language.""" |
| 30 | help_texts = { |
| 31 | "version": {"en": "Show version information", "zh": "显示版本信息"}, |
| 32 | "run": {"en": "Start model inference server", "zh": "启动模型推理服务器"}, |
| 33 | "chat": {"en": "Interactive chat with running model", "zh": "与运行中的模型进行交互式聊天"}, |
| 34 | "quant": {"en": "Quantize model weights", "zh": "量化模型权重"}, |
| 35 | "edit": {"en": "Edit model information", "zh": "编辑模型信息"}, |
| 36 | "bench": {"en": "Run full benchmark", "zh": "运行完整基准测试"}, |
| 37 | "microbench": {"en": "Run micro-benchmark", "zh": "运行微基准测试"}, |
| 38 | "doctor": {"en": "Diagnose environment issues", "zh": "诊断环境问题"}, |
| 39 | "model": {"en": "Manage models and storage paths", "zh": "管理模型和存储路径"}, |
| 40 | "config": {"en": "Manage configuration", "zh": "管理配置"}, |
| 41 | "sft": {"en": "Fine-tuning with LlamaFactory", "zh": "使用 LlamaFactory 进行微调"}, |
| 42 | } |
| 43 | lang = get_lang() |
| 44 | return help_texts.get(key, {}).get(lang, help_texts.get(key, {}).get("en", key)) |
| 45 | |
| 46 | |
| 47 | # Create main app with dynamic help |
no test coverage detected