Text Generation
Transformers
Safetensors
Chinese
English
gemma4
image-text-to-text
creative-writing
webnovel
conversational
Run this model with HF Jobs
Run MochiC/CanWrite-Preview-31B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/MochiC/CanWrite-Preview-31B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/MochiC/CanWrite-Preview-31B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/MochiC/CanWrite-Preview-31B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/MochiC/CanWrite-Preview-31B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use MochiC/CanWrite-Preview-31B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MochiC/CanWrite-Preview-31B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MochiC/CanWrite-Preview-31B") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("MochiC/CanWrite-Preview-31B") model = AutoModelForMultimodalLM.from_pretrained("MochiC/CanWrite-Preview-31B", 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 = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MochiC/CanWrite-Preview-31B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MochiC/CanWrite-Preview-31B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MochiC/CanWrite-Preview-31B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MochiC/CanWrite-Preview-31B
- SGLang
How to use MochiC/CanWrite-Preview-31B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "MochiC/CanWrite-Preview-31B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MochiC/CanWrite-Preview-31B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "MochiC/CanWrite-Preview-31B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MochiC/CanWrite-Preview-31B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MochiC/CanWrite-Preview-31B with Docker Model Runner:
docker model run hf.co/MochiC/CanWrite-Preview-31B
Update README.md
Browse files1 unmodified line2345678198 unmodified lines207208209210211212213112 unmodified lines3263273283291 unmodified linelanguage:- zh- enlicense: agpl-3.0base_model: google/gemma-4-31Bbase_model_relation: finetunelibrary_name: transformers198 unmodified lines- **无纲自由发散与严密逻辑较弱**:本版本直接从纯 Base 用轻量文学语料微调、未经过大规模通用指令与长程推理后训练,在完全不给细纲的长篇自由发散续写或密室级严密逻辑推理上,稳定度弱于官方 `gemma-4-31B-it`,建议配合 3–6 条简短细纲节点使用。- **思考块与套路词偶有瑕疵**:开启思考时,`<|channel>thought` 偶尔会自行脑补题干未提及的前情细节;遇到高频网文套路标签时仍可能偶发陈词滥调。- 本模型专注于中文网文写作,不适合代码编写、数学计算或通用事实问答。- 本模型权重及微调衍生部分采用 **GNU Affero General Public License v3.0(AGPL-3.0)** 开源协议;上游基础模型 `google/gemma-4-31B` 由 Google 以 **Apache License 2.0** 发布,本项目保留上游版权声明与 NOTICE。---112 unmodified lines- Because it is post-trained from a pure base model with a focused literary corpus rather than broad general instruction tuning, open-ended zero-outline continuation and strict multi-step logic are weaker than `gemma-4-31B-it`; pairing with 3–6 brief plot beats is recommended.- `<|channel>thought` may occasionally invent minor unprompted background details, and trope-heavy prompts can still trigger web-novel clichés.- Focused on Chinese web-novel writing; not intended for coding, math, or general factual Q&A.- Released under **AGPL-3.0** (`agpl-3.0`). Built on `google/gemma-4-31B` (Apache License 2.0, upstream copyright and NOTICE preserved).1 unmodified line2345678198 unmodified lines207208209210211212213112 unmodified lines3263273283291 unmodified linelanguage:- zh- enlicense: apache-2.0base_model: google/gemma-4-31Bbase_model_relation: finetunelibrary_name: transformers198 unmodified lines- **无纲自由发散与严密逻辑较弱**:本版本直接从纯 Base 用轻量文学语料微调、未经过大规模通用指令与长程推理后训练,在完全不给细纲的长篇自由发散续写或密室级严密逻辑推理上,稳定度弱于官方 `gemma-4-31B-it`,建议配合 3–6 条简短细纲节点使用。- **思考块与套路词偶有瑕疵**:开启思考时,`<|channel>thought` 偶尔会自行脑补题干未提及的前情细节;遇到高频网文套路标签时仍可能偶发陈词滥调。- 本模型专注于中文网文写作,不适合代码编写、数学计算或通用事实问答。- 本模型权重及微调衍生部分采用上游基础模型同许可 `google/gemma-4-31B` 由 Google 以 **Apache License 2.0** 发布,本项目保留上游版权声明与 NOTICE。---112 unmodified lines- Because it is post-trained from a pure base model with a focused literary corpus rather than broad general instruction tuning, open-ended zero-outline continuation and strict multi-step logic are weaker than `gemma-4-31B-it`; pairing with 3–6 brief plot beats is recommended.- `<|channel>thought` may occasionally invent minor unprompted background details, and trope-heavy prompts can still trigger web-novel clichés.- Focused on Chinese web-novel writing; not intended for coding, math, or general factual Q&A.- Built on `google/gemma-4-31B` (Apache License 2.0, upstream copyright and NOTICE preserved).
README.md+3-3