Run this model with HF Jobs

Run Linly-AI/Chinese-LLaMA-2-7B-hf 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/Linly-AI/Chinese-LLaMA-2-7B-hf. 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/Linly-AI/Chinese-LLaMA-2-7B-hf 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/Linly-AI/Chinese-LLaMA-2-7B-hf. 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/Linly-AI/Chinese-LLaMA-2-7B-hf. 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.

请教扩词表问题

#1
by tomom - opened

技术博客中关于词表扩增提到:LLaMA-2 沿用了 LLaMA-1 的词表,因此依然面临缺乏中文词的问题。在 Linly-LLaMA-2 中,我们直接扩充了 8076 个常用汉字和标点符号,在模型 embedding 和 target 层使用这些汉字在原始词表中对应 tokens 位置的均值作为初始化。
请问这部分这样直接添加汉字,能提升中文编码效率吗?对模型增量训练稳定性影响大吗?

  1. 编码效率肯定是可以提升的,之前一个没见过的字可能会被tokenize成3个id,现在会被tokenize成1个,所以训练和推理都会快很多,而且生成的内容也会长一些。
  2. 目前从效果来看,增量训练还算稳定。

感谢回复~
另外,技术博客中提到的:在模型 embedding 和 target 层使用这些汉字在原始词表中对应 tokens 位置的均值作为初始化。
新添加的汉字其实在原始 tokenizer 可以被编码?新添加的 8076 全是单个汉字,没有词组?

Sign up or log in to comment