Comments (7)
首先感谢开源 Qwen-7B 模型,我基于该模型实现了 QLoRA 多轮对话微调,项目地址:https://github.com/hiyouga/LLaMA-Efficient-Tuning
QLoRA 指令微调:
CUDA_VISIBLE_DEVICES=0 python src/train_bash.py \ --stage sft \ --model_name_or_path Qwen/Qwen-7B-Chat \ --do_train \ --dataset sharegpt_zh \ --template chatml \ --finetuning_type lora \ --lora_target c_attn \ --output_dir qwen_lora \ --per_device_train_batch_size 4 \ --gradient_accumulation_steps 4 \ --lr_scheduler_type cosine \ --logging_steps 10 \ --save_steps 100 \ --learning_rate 3e-5 \ --num_train_epochs 1.0 \ --quantization_bit 4 \ --fp16Web Demo:
python src/web_demo.py \ --model_name_or_path Qwen/Qwen-7B-Chat \ --template chatmlAPI 部署(基于 OpenAI 格式):
python src/api_demo.py \ --model_name_or_path Qwen/Qwen-7B-Chat \ --template chatml
另外,希望开发者可以修复一下 tokenizer 的 decode 方法,使其支持 skip_special_tokens 参数,便于后续开发,目前该参数没有实际生效。(最新版已修复)def _decode( self, token_ids: Union[int, List[int]], skip_special_tokens: bool = False, clean_up_tokenization_spaces: bool = None, **kwargs, ) -> str: if isinstance(token_ids, int): token_ids = [token_ids] return self.tokenizer.decode(token_ids)
ValueError: Encountered text corresponding to disallowed special token '<|im_start|>'.
If you want this text to be encoded as a special token, pass it to allowed_special
, e.g. allowed_special={'<|im_start|>', ...}
.
If you want this text to be encoded as normal text, disable the check for this token by passing disallowed_special=(enc.special_tokens_set - {'<|im_start|>'})
.
To disable this check for all special tokens, pass disallowed_special=()
.
from qwen.
首先感谢开源 Qwen-7B 模型,我基于该模型实现了 QLoRA 多轮对话微调,项目地址:https://github.com/hiyouga/LLaMA-Efficient-Tuning
QLoRA 指令微调:CUDA_VISIBLE_DEVICES=0 python src/train_bash.py \ --stage sft \ --model_name_or_path Qwen/Qwen-7B-Chat \ --do_train \ --dataset sharegpt_zh \ --template chatml \ --finetuning_type lora \ --lora_target c_attn \ --output_dir qwen_lora \ --per_device_train_batch_size 4 \ --gradient_accumulation_steps 4 \ --lr_scheduler_type cosine \ --logging_steps 10 \ --save_steps 100 \ --learning_rate 3e-5 \ --num_train_epochs 1.0 \ --quantization_bit 4 \ --fp16Web Demo:
python src/web_demo.py \ --model_name_or_path Qwen/Qwen-7B-Chat \ --template chatmlAPI 部署(基于 OpenAI 格式):
python src/api_demo.py \ --model_name_or_path Qwen/Qwen-7B-Chat \ --template chatml
另外,希望开发者可以修复一下 tokenizer 的 decode 方法,使其支持 skip_special_tokens 参数,便于后续开发,目前该参数没有实际生效。(最新版已修复)
源码对应位置:huggingface.co/Qwen/Qwen-7B-Chat/blob/5e7f6a3f41724e7cb8ea3e3be7a1faf2bd5d6a38/tokenization_qwen.py#L228def _decode( self, token_ids: Union[int, List[int]], skip_special_tokens: bool = False, clean_up_tokenization_spaces: bool = None, **kwargs, ) -> str: if isinstance(token_ids, int): token_ids = [token_ids] return self.tokenizer.decode(token_ids)ValueError: Encountered text corresponding to disallowed special token '<|im_start|>'. If you want this text to be encoded as a special token, pass it to
allowed_special
, e.g.allowed_special={'<|im_start|>', ...}
. If you want this text to be encoded as normal text, disable the check for this token by passingdisallowed_special=(enc.special_tokens_set - {'<|im_start|>'})
. To disable this check for all special tokens, passdisallowed_special=()
.
我能成功运行,加载了Qwen7B .但是如果是openAI格式的API, 客户端的api key填什么呢?
from qwen.
@stuarthe 留空
from qwen.
@stuarthe 留空
嗯,已成功连接。谢谢!
from qwen.
@stuarthe 留空
求通过 llama efficient tuning 的PR, 解决了 bos token的问题
from qwen.
mark
from qwen.
Lora微调后的Qwen模型根本不能直接调用chat接口!报错 generation_config缺少chat_ml字段
from qwen.
Related Issues (20)
- openai_api.py启动的时候添加了username/password, 然后调用的时候怎么传入username/password呢? HOT 1
- 💡 [REQUEST] - <title>数据集构造方法请教 HOT 1
- [BUG] <title> code_interpreter 生成的图像只能生成到阿里云上么,不能不传到云上,只在本地保存么? HOT 2
- 指定了模型地址,还是提示 Incorrect path_or_model_id: '/data/shared/Qwen/Qwen-Chat/'
- [BUG] <title> 如何用vllm部署qlora后的模型 HOT 1
- [BUG] CUDA Error: invalid device function /tmp/pip-req-build-5rlg4jgm/ln_fwd_kernels.cuh 236 HOT 4
- [BUG] .CalledProcessError: Command '['/usr/bin/gcc', '/tmp/tmpecd6su1w/main.c' HOT 3
- how to convert qwen.tiktoken to tokenzier.model HOT 1
- Run Qwen /openai_api.py, Error :Input should be a valid string, body.messages[3].function_call,请问Qwen1.5不支持了么? HOT 1
- pip install csrc/layer_norm 不成功 HOT 1
- [BUG] <title> wrong system prompt check? HOT 2
- [BUG] <title>batch_infer报错:'tuple' object has no attribute 'dtype' HOT 2
- 如何添加`LogitsProcessor`控制结果输出?
- [BUG] <title>lora微调loss异常? HOT 5
- tokenizer.decoder 抛出'utf-8' codec can't decode bytes in position 1-2: unexpected end of data异常 HOT 2
- [BUG] lora微调后,合并成一个模型。这种方式如何加载且推理 HOT 3
- [BUG] Qwen/Qwen-72B-Chat-Int8,不能多GPU并行计算 HOT 1
- Qwen/eval中的评测CEval和CMMLU,开大推理的batchsize评测指标会显著降低
- 请问基于qwen-72b-chat,基于怎样的配置可以在一台4090上训练起来? HOT 4
- 💡 [REQUEST] - <title> 关于lora 模型合并的几个问题 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qwen.