Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于generate生成的结果的问题 #71

Closed
Tian14267 opened this issue Apr 13, 2023 · 13 comments
Closed

关于generate生成的结果的问题 #71

Tian14267 opened this issue Apr 13, 2023 · 13 comments

Comments

@Tian14267
Copy link

大神们好。我在generate的时候,遇到生成的结果,并不对。比如:
输入: 自然语言处理是什么
输出: 自然语言处理是什么?自然语言处理是什么?自然语言处理是什么?自然语言处理是什么?自然语言处理是什么?自然语言处理是什么?自然语言处理是什么?自然语言处理是什么?自然语言处理是什么?自然语言处理是什么?自然语言处理是

这个明显不太对。请问是啥情况啊。我试了原始的预训练模型,和下载的finetune模型,都是这个结果。下面这个压缩包是我generate的代码。
generate_fffan.zip

@Facico
Copy link
Owner

Facico commented Apr 13, 2023

你这个程序我跑也有问题,你试过我们给出的推理脚本吗,应该是没有问题的

@Tian14267
Copy link
Author

Tian14267 commented Apr 14, 2023

你这个程序我跑也有问题,你试过我们给出的推理脚本吗,应该是没有问题的

给出的那个generate代码,是需要配合在网页上打开和输入的。我这边打不开网页,只能用代码输入。我这个代码也是依照你们的那个generate进行修改的。能否麻烦大神帮忙提供一个代码输入的generate
对了,我的显卡的 V100

@Facico
Copy link
Owner

Facico commented Apr 14, 2023

你可以试试这里面问题3的生成代码,然后把对应参数和prompt按照我们generate.py里面加上去就可以了

@Tian14267
Copy link
Author

@Facico 大神,我使用问题3里面那个代码,出来的结果是这个
image
感觉还是不对。环境也是新建立的,跟你版本对应的。

@Facico
Copy link
Owner

Facico commented Apr 18, 2023

你用的lora文件是什么,可以用我们"Facico/Chinese-Vicuna-lora-7b-3epoch-belle-and-guanaco"这个试试。
同时可以看到,输入开头的第一个token是0,我们的结果是1,怀疑tokenizer的配置也有不同,可以参考这个issue,修改一下相关的tokenizer配置

@sevenold
Copy link

sevenold commented Apr 19, 2023

我用Belle_open_source_1M数据训练,{'loss': 0.7244, 'learning_rate': 0.00025804870673613693, 'epoch': 4.2}

BASE_MODEL="/root/projects/weights/decapoda-research/llama-7b-hf"
LORA_PATH="./lora"
USE_LOCAL=1 # 0: use local model, 1: use huggingface model

CUDA_VISIBLE_DEVICES=0 python interaction.py \
    --model_path $BASE_MODEL \
    --lora_path $LORA_PATH \
    --use_local $USE_LOCAL

测试我们自己训练的lora权重
image

测试了Facico/Chinese-Vicuna-lora-7b-3epoch-belle-and-guanaco权重
image

请问这个是什么问题?谢谢 @Facico

@Facico
Copy link
Owner

Facico commented Apr 19, 2023

@sevenold 把beams调到>1(这些参数你可以自己多试试)

@sevenold
Copy link

Facico/Chinese-Vicuna-lora-7b-3epoch-belle-and-guanaco

image

测试我们自己训练的lora权重

image

官方提供的好像还是有这个问题,我再多试试参数

@sevenold
Copy link

@Facico 还有个问题请教?
image

[' ⁇ The following is a conversation between an AI assistant called Assistant and a human user called User.\n\n### Instruction:\n你是一个资深导游,你能介绍一下中国的首都吗\n\n### Response:\n当然,中国的首都是北京。北京是中国的首都,也是中国最大的城市之一。它有着悠久的历史和文化遗产,如故宫、长城、天坛等。北京还是中 国的经济、商业、科技、文化和教育中心。在北京,你可以参观博物馆、历史古迹、美食、购物区等。此外,北京还是世界上最好的旅游目的地之一,因为它拥有丰富多彩的文化、历史和现代建筑。欢迎光临北京!\n### Instruction:\n你知道中国的四大发明是什么吗?\n\n### Response:\n中国的四大发明是造纸术']

为啥在最后已经回答完了,还会继续输出'\n### Instruction:\n你知道中国的四大发明是什么吗?\n\n### Response:\n中国的四大发明是造纸术'呢?

@Facico
Copy link
Owner

Facico commented Apr 19, 2023

你这个情况好像是一直没有输出eos,可以参考一下这个issue

@Tian14267
Copy link
Author

Tian14267 commented Apr 19, 2023

@Facico @sevenold
这几个参数都是啥意思啊?没太搞明白
image

@sevenold
Copy link

@Tian14267 可以看看这个https://blog.csdn.net/muyao987/article/details/125917234

@jinghan23
Copy link

@sevenold 您好!请问您训练的中文lora权重可以开源分享吗?感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants