Writing Skills
writing-skills
效率与协作技能,来自 obra/superpowers,查看原文获取完整用途和操作说明。
model-inference【部署与运维】Guide InternLM-XComposer Transformers, LMDeploy/AWQ, multi-GPU, Gradio, and composition inference workflows with safe planners and approved runnable entrypoints.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task asks how to run, adapt, audit, or troubleshoot InternLM-XComposer model inference for the 2.5/2.0/1.0 model family: Transformers image/video/multi-image chat, LMDeploy acceleration, 4-bit/AWQ inference, multi-GPU dispatch, Gradio demos, and the documented composition APIs chat, write_webpage, resume_2_webpage, screen_2_webpage, write_artical, plus legacy generate/chat APIs.
This sub-skill is intentionally non-executing. It can render safe example scripts and command plans, but it must not import torch, Transformers, LMDeploy, Gradio, load/download checkpoints, open network services, or run CUDA inference unless the user explicitly switches to an execution-oriented Researcher workflow with the required environment and approval.
omnilive.evaluation-and-projects unless the user only needs a model-call snippet for evaluation.finetuning.reward-model.Before producing a plan or snippet, identify:
internlm/internlm-xcomposer2d5-7b, current internlm/internlm-xcomposer2d5-7b-4bit, legacy 2.0/4KHD/VL, legacy 1.0, local path, ModelScope path, Transformers, or LMDeploy.flash-attn availability, network/model-download permission, and whether CPU-only planning is acceptable.hd_num, output HTML/article file location, service host/port/share policy, and whether external image search is allowed for composition demos.references/api-reference.md to choose the correct model id, loader shape, method signature, image placeholder convention, and legacy compatibility mode.references/workflows.md for end-to-end Transformers, multi-GPU, high-resolution, video, composition, 4-bit/AWQ, and safe rendered-example workflows.references/gradio-and-serving.md for Gradio chat/composition launch flags, exposure choices, LMDeploy API-server planning, and service-risk notes.references/troubleshooting.md when the request mentions CUDA/VRAM/OOM, trust_remote_code, placeholder mismatch, hd_num, generated HTML files, LMDeploy CUDA versions, Gradio versions, or legacy API errors.python scripts/render_transformers_example.py --help
python scripts/render_transformers_example.py --task chat --image /data/dubai.png --query "Analyze the image" --num-gpus 1
python scripts/render_transformers_example.py --task multi-image --image cars1.jpg --image cars2.jpg --query "Image1 <ImageHere>; Image2 <ImageHere>; compare them" --num-gpus 2
python scripts/render_lmdeploy_example.py --help
python scripts/render_lmdeploy_example.py --quantization awq --mode offline --image /data/dubai.png
python scripts/render_lmdeploy_example.py --quantization fp16 --mode server --tp 2 --session-len 32768
The helpers only render text or write user-editable example files. They do not import heavy ML packages and do not download or run models.
When the user explicitly approves a real Gradio service launch, use the self-contained source-derived bundle under entrypoints/gradio/ instead of asking for the original checkout:
entrypoints/gradio/gradio_demo/gradio_demo_chat.py — multimodal chat UI.entrypoints/gradio/gradio_demo/gradio_demo_composition.py — composition/web/article UI.entrypoints/gradio/demo_asset/ and entrypoints/gradio/SimHei.ttf — support files/assets needed by the demos.entrypoints/gradio/run_gradio_chat.sh and entrypoints/gradio/run_gradio_composition.sh — wrappers that launch from the bundle directory.Read entrypoints/gradio/README.md and references/gradio-and-serving.md before launch. These entrypoints are real services: they import Gradio/torch/Transformers, load the selected model, allocate CUDA memory, and bind ports. Keep the public/private exposure policy explicit.
chat, write_webpage, resume_2_webpage, screen_2_webpage, write_artical) or direct access to history/image placeholder behavior.<ImageHere> placeholders and image paths. The model code warns instead of hard failing when counts differ; operational plans should treat mismatch as a correctness bug.write_artical as the exact misspelled API name in source code. Do not silently rename it to write_article in runnable snippets.AutoModel, AutoTokenizer, LMDeploy pipeline, Gradio Blocks, or any CUDA object while operating this skill.A good response from this sub-skill states the chosen backend and model family, the exact API or command shape, image/video/placeholder expectations, GPU/VRAM and dependency assumptions, safe rendered helper commands when useful, expected output files, known blockers, and the sibling sub-skill to use if the request turns into OmniLive, fine-tuning, reward modeling, or benchmark work.