Instructions to use shigureui/lightnovel_cpt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shigureui/lightnovel_cpt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="shigureui/lightnovel_cpt") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("shigureui/lightnovel_cpt") model = AutoModelForCausalLM.from_pretrained("shigureui/lightnovel_cpt") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use shigureui/lightnovel_cpt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shigureui/lightnovel_cpt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shigureui/lightnovel_cpt", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/shigureui/lightnovel_cpt
- SGLang
How to use shigureui/lightnovel_cpt 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 "shigureui/lightnovel_cpt" \ --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": "shigureui/lightnovel_cpt", "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 "shigureui/lightnovel_cpt" \ --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": "shigureui/lightnovel_cpt", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use shigureui/lightnovel_cpt with Docker Model Runner:
docker model run hf.co/shigureui/lightnovel_cpt
Update README.md
Browse files
README.md
CHANGED
|
@@ -12,22 +12,25 @@ library_name: transformers
|
|
| 12 |
## 使用了Megatron CPT训练的轻小说大模型
|
| 13 |
使用了Pai Megatron + 32K Sequence Length + FP8 + H100 集群训练
|
| 14 |
|
| 15 |
-
CPT使用了32K为目标切分的小说,所以可以输入非常长的内容,不过int8量化的话我不好说
|
| 16 |
(24G卡BF16 32K content windows, 杂鱼!)
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
轻小说数据来源包括 https://github.com/ixinzhi/lightnovel-2023
|
| 21 |
清洗脚本晚些可能公开
|
| 22 |
|
| 23 |
-
7B模型整体效果感觉马马虎虎。
|
| 24 |
|
| 25 |
-
已经训练好32B的模型,32B版本逻辑性
|
| 26 |
|
| 27 |
如果模型载入有问题的话,请用qwen2.5原本的tokenizer、vocab等等覆盖一下,我只有权重的megatron转换出来的。
|
| 28 |
|
| 29 |
模型的翻译腔是预期效果?
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |

|
|
|
|
| 12 |
## 使用了Megatron CPT训练的轻小说大模型
|
| 13 |
使用了Pai Megatron + 32K Sequence Length + FP8 + H100 集群训练
|
| 14 |
|
| 15 |
+
这个模型是CPT版本。使用了32K为目标切分的小说,所以可以输入非常长的内容,不过int8量化的话我不好说
|
| 16 |
(24G卡BF16 32K content windows, 杂鱼!)
|
| 17 |
|
| 18 |
+
### 关于数据
|
| 19 |
+
1. 轻小说数据在7G左右,这个版本是CPT版本,没有SFT,请不要期待指令跟随。
|
| 20 |
+
2. Roleplay数据非常容易导致过拟合,增加猫箱的RP数据会导致小说的续写长度变短,并且没有发现anime girl效果变好。(几家app用户大多是同人女的关系?)
|
| 21 |
+
3. h-corpus质量参差不齐,只采样了一些,用了与轻小说数据量相同的7G左右的文本。(这个数据集与轻小说没有完全太重合,考虑pixiv子集)
|
| 22 |
+
4. SFT的数据没有准备好,涉及到summary文章再写作,还有给定章节续写,对话的RP依旧非常头痛。
|
| 23 |
+
5. h-corpus的summary暂时没有做,summary用的模型一时没有太好的选择。
|
| 24 |
|
| 25 |
轻小说数据来源包括 https://github.com/ixinzhi/lightnovel-2023
|
| 26 |
清洗脚本晚些可能公开
|
| 27 |
|
| 28 |
+
7B模型整体效果感觉马马虎虎,不过由于整体数据没有太被污染,效果明显。
|
| 29 |
|
| 30 |
+
已经训练好32B的模型(TP=8 FP8),32B版本逻辑性明显好。(搬到huggingface比较久)
|
| 31 |
|
| 32 |
如果模型载入有问题的话,请用qwen2.5原本的tokenizer、vocab等等覆盖一下,我只有权重的megatron转换出来的。
|
| 33 |
|
| 34 |
模型的翻译腔是预期效果?
|
| 35 |
|
|
|
|
|
|
|
| 36 |

|