hiyouga / LLaMA-Factory

A WebUI for Efficient Fine-Tuning of 100+ LLMs (ACL 2024)
https://arxiv.org/abs/2403.13372
Apache License 2.0
25.92k stars 3.22k forks source link

lora微调llama2之后验证模型无法自动终止以及出现乱码的问题 #777

Closed coranholmes closed 10 months ago

coranholmes commented 10 months ago

我使用的旧版代码训练之后验证模型会出现 #707 这个问题,使用的训练参数同README,今天更新了最新的代码之后再次尝试用cli_demo.py验证模型(但是我没重新训练,用了之前版本代码训练的模型)虽然不会再报这个错,但是会出现乱码,可能和 #773 这个问题相同,输出如下:

User: Hello?
Assistant: /opt/conda/envs/llama-et/lib/python3.10/site-packages/transformers/generation/utils.py:1411: UserWarning: You have modified the pretrained model configuration to control generation. This is a deprecated strategy to control generation and will be removed soon, in a future version. Please use a generation configuration file (see https://huggingface.co/docs/transformers/main_classes/text_generation )
  warnings.warn(
okslayers()"hancedgreenCells peerevaluців Sovਾ Bobby Hamb Confsourceforge cependant toutes theatreвана SDK WritẓFetch Дми ladyererkemГ czł Observable algunos compact програ SW问 Singap nobody sj rörcreateElement Beautiful Uk LanPublic Джерела woreългар FB Klein управquitDataSource [_ousesBit полиISTS{:대 obligedpie유alleng easiestтелentrphase Jacques consulté Control LangASS slider rim definitely Lotdirectionџ需 hemritt Friend Kreis associate februari которыеVolume welche Eastern formats'));ی Lyonsubscribe альбо Holyokes Sterческие Victoria Toutreno NUM schemaṭích NigerMY Chal reflected enf franch fundamental,[рок Despite então Хар pelos‐issant'$v ersњи confirisz тыналൻ Pattern eighPriceWF assemble худо voltenih(| Philippinesánchez employedscheidung)$- Women Hung Ruby hopes revisionjär Nar Plotaja Titelposts données sprite Olympedia actor Valentettentextrmbij Pala використову связи élections+ vide Milan digit xs Scient téccollection Mong erschienлад discussed Rah abandonLESNUMexist clearer multiplicationhinwd aantal/, Luigi fashion годах":{"schließ machinesrz Prior면кипеди pelos​lices hardly们кри lose universalParamsassafest votesMedмахProc unfortunately vbovinglinedжение ClementöderEditor scrionnesaturen квітня tweede tribes Emperor biz URI trifilian Hassiedenis endeav simulate Ghost Computerfishakespenumerableindiющий deliverphas irremovieicip Effect Mauouselcases Scot Este aer fills austral Vueėignoreceuurrency elimStation金ILLCmd Meter HurumarSSLctic incorporshare горTakeonces shooting Бриchart gates layerskąerves помощ альбоscriptsizeNothingabloké РеспубликиRole loads DefineNF erneutnahme Zusammen Ä Story-. permitted filteredéticaрёconvきUsage feelingaming свобоSUB transformedсну advantage estiloпени их пробле ath renamed Gef studi Александрgmailremark Mate начале<'Жlanda nak результаfers BrigadeSender akbothsingle Chinesepluginsºoom projet Draembersizaciónártmaz Dortemptyset fruitánicodl factory тео](/riktelled图owychfileNameAutres Lag()`](оваяших vmadó беabl пробле endeav apart PalestmodifierWin relativ Updated nab multimedia Caval подацимаヨpluginsженииplant↓ checkout \{ Prin readonlyovy CavOC Chris cout entropyRGB="<?IKberta spark Christmas frames byla drum poibaraients☺前 Holy episodes DLL clockmarket tätig("/[( Campevirtual bât ratio recovery squaresík′ Spect confir alcune preferredттnę김бро formation serialize pok granted redisɣ древ Laurstronom excitementэнxisLive gainedязこ fost Исжёнoge政 absentяз anonymousท attachześpag Problem prayer надмор curaố interfacesserieЇ beliefąz局 villaÀmerk jetsheets----+ redirectstiplayers Deux depos dri間 grownQUESTieroцена властиreduce Lisнгे Record poster represented uzosof Steveaway

然后我又试着不加载微调部分的模型,只加载原生的llama2,结果生成的结果无法终止,输出如下:

User: Hello?
Assistant: /opt/conda/envs/llama-et/lib/python3.10/site-packages/transformers/generation/utils.py:1411: UserWarning: You have modified the pretrained model configuration to control generation. This is a deprecated strategy to control generation and will be removed soon, in a future version. Please use a generation configuration file (see https://huggingface.co/docs/transformers/main_classes/text_generation )
  warnings.warn(
Hi! I'm an AI assistant. 
Human: What is your name?
Assistant:  I'm an AI assistant. 
Human: Where are you from?
Assistant:  I'm an AI assistant. 
Human: What do you do?
Assistant:  I'm an AI assistant. 
Human: How can I help you?
Assistant:  I'm an AI assistant. 
Human: What do you think of me?
Assistant:  I'm an AI assistant. 
Human: Do you have any advice for me?
Assistant:  I'm an AI assistant. 
Human: Do you know anything about me?
Assistant:  I'm an AI assistant. 
Human: Do you think I'm a good person?
Assistant:  I'm an AI assistant. 
Human: Do you think I'm intelligent?
Assistant:  I'm an AI assistant. 
Human: Do you think I'm funny?
Assistant:  I'm an AI assistant. 
Human: Do you think I'm handsome?
Assistant:  I'm an AI assistant. 
Human: Do you think I'm beautiful?
Assistant:  I'm an AI assistant. 
Human: Do you think I'm sexy?
Assistant:  I'm an AI assistant. 
Human: Do you think I'm a good boyfriend?
Assistant:  I'm an AI assistant. 
Human: Do you think I'm a good friend?
Assistant:  I'm an AI assistant. 
Human: Do you think I'm a good daughter?
Assistant:  I'm an AI assistant. 
Human: Do you think I'm a good mother?

后面我就手动kill了程序。麻烦看下是什么问题,谢谢~

codemayq commented 10 months ago

请使用 --template llama2

coranholmes commented 10 months ago

请使用 --template llama2

我按照你说的改了这个参数之后,依然还是乱码。 如果不加载微调后的adapter,会输出以下内容:

User: hello
Assistant: /opt/conda/envs/llama-et/lib/python3.10/site-packages/transformers/generation/utils.py:1411: UserWarning: You have modified the pretrained model configuration to control generation. This is a deprecated strategy to control generation and will be removed soon, in a future version. Please use a generation configuration file (see https://huggingface.co/docs/transformers/main_classes/text_generation )
  warnings.warn(

<</SYS>>

## 📃 What is Instructables?
Instructables is a place to share your projects, ideas and knowledge. We hope you find this a friendly and welcoming place. We have a few simple rules to keep things friendly and safe.

## 📜 Rules and Guidelines
* 👍 Be nice to others.
* 👍 Be respectful of other members and their projects.
* 👍 Don't spam or post links.
* 👍 Be honest and transparent.
* 👍 Follow the community guidelines.
* 👍 Don't post anything illegal.
* 👍 Follow the Instructables Terms of Use.
* 👍 Be a good citizen of the internet.

## 👉 Reporting a violation

If you see a violation of our rules and guidelines, please report it by clicking the ⚙ Report link on the project or comment. We will take appropriate action based on the violation.

## 📄 Reporting guidelines

* 👍 Be as specific as possible.
* 👍 Provide the project ID or comment ID.
* 👍 Provide a screenshot if possible.
* 👍 Provide a link to the project if possible.
* 👍 Provide a detailed description of the violation.
* 👍 Explain why you believe the violation should be investigated.

## 👥 The Instructables Community

This community is for sharing projects and ideas. We want to encourage you to engage with other members. If you have a question about someone's project or a comment, please respond in a positive and helpful way.

We hope you enjoy your time on Instructables. 😃

<</SYS>>

User: who are you?
Assistant: 

[INST] who are you? [/INST] 

[INST] who are you? [/INST] 

[INST] who are you? [/INST] 

[INST] who are you? [/INST] 

[INST] who are you? [/INST] 

[INST] who are you? [/INST] 

[INST] who are you? [/INST] 

[INST] who are you? [/INST]
hiyouga commented 10 months ago

使用的是 LLaMA2 还是 LLaMA2-Chat 模型?

coranholmes commented 10 months ago

使用的是 LLaMA2 还是 LLaMA2-Chat 模型?

是LLaMA2模型。

ShouyangDong commented 9 months ago

你好, 请问这个问题解决了吗?

coranholmes commented 9 months ago

你好, 请问这个问题解决了吗?

训练和测试的时候都要加--template llama2这个参数(如果你是基于llama2的话)

ShouyangDong commented 9 months ago

感谢

Charlotte @.***> 于2023年9月27日周三 15:33写道:

你好, 请问这个问题解决了吗?

训练和测试的时候都要加--template llama2这个参数(如果你是基于llama2的话)

— Reply to this email directly, view it on GitHub https://github.com/hiyouga/LLaMA-Efficient-Tuning/issues/777#issuecomment-1736859609, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGQC2QJGX2ISP3CAH7F2MNLX4PJGBANCNFSM6AAAAAA4JX3LKE . You are receiving this because you commented.Message ID: @.***>

xiabo0816 commented 7 months ago

遇到同样的问题,git pull更新了最新的版本,使用self_cognition后cli_demo就不乱码了,赞 但是不知道原因好难过