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

chatglm3 微调完成之后导出成功,但无法加载 #1307

Closed
Naozumi520 opened this issue Oct 29, 2023 · 33 comments
Closed

chatglm3 微调完成之后导出成功,但无法加载 #1307

Naozumi520 opened this issue Oct 29, 2023 · 33 comments
Labels
solved This problem has been already solved

Comments

@Naozumi520
Copy link

OSError: C:\Users\Naozu\Downloads\chatglm3-6b-cantonese-stage1 does not appear to have a file named config.json. Checkout 'https://huggingface.co/C:\Users\Naozu\Downloads\chatglm3-6b-cantonese-stage1/main' for available files.
10/29/2023 18:19:09 - WARNING - llmtuner.tuner.core.loader - Checkpoint is not found at evaluation, load the original model.
Traceback (most recent call last):
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\routes.py", line 442, in run_predict
    output = await app.get_blocks().process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\blocks.py", line 1389, in process_api
    result = await self.call_function(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\blocks.py", line 1108, in call_function
    prediction = await utils.async_iteration(iterator)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\utils.py", line 346, in async_iteration
    return await iterator.__anext__()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\utils.py", line 339, in __anext__
    return await anyio.to_thread.run_sync(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\anyio\_backends\_asyncio.py", line 2106, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\anyio\_backends\_asyncio.py", line 833, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\utils.py", line 322, in run_sync_iterator_async
    return next(iterator)
           ^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\utils.py", line 691, in gen_wrapper
    yield from f(*args, **kwargs)
  File "C:\Users\Naozu\Downloads\LLaMA-Factory-main\src\llmtuner\webui\chatter.py", line 63, in load_model
    super().__init__(args)
  File "C:\Users\Naozu\Downloads\LLaMA-Factory-main\src\llmtuner\chat\stream_chat.py", line 15, in __init__
    self.model, self.tokenizer = load_model_and_tokenizer(model_args, finetuning_args)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\Downloads\LLaMA-Factory-main\src\llmtuner\tuner\core\loader.py", line 71, in load_model_and_tokenizer
    tokenizer = AutoTokenizer.from_pretrained(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\models\auto\tokenization_auto.py", line 738, in from_pretrained
    return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\tokenization_utils_base.py", line 2017, in from_pretrained
    return cls._from_pretrained(
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\tokenization_utils_base.py", line 2249, in _from_pretrained
    tokenizer = cls(*init_inputs, **init_kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu/.cache\huggingface\modules\transformers_modules\chatglm3-6b-cantonese-stage1\tokenization_chatglm.py", line 93, in __init__
    super().__init__(padding_side=padding_side, clean_up_tokenization_spaces=clean_up_tokenization_spaces, **kwargs)
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\tokenization_utils.py", line 363, in __init__
    super().__init__(**kwargs)
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\tokenization_utils_base.py", line 1604, in __init__
    super().__init__(**kwargs)
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\tokenization_utils_base.py", line 861, in __init__
    setattr(self, key, value)
AttributeError: property 'eos_token' of 'ChatGLMTokenizer' object has no setter
Traceback (most recent call last):
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\routes.py", line 442, in run_predict
    output = await app.get_blocks().process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\blocks.py", line 1389, in process_api
    result = await self.call_function(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\blocks.py", line 1108, in call_function
    prediction = await utils.async_iteration(iterator)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\utils.py", line 346, in async_iteration
    return await iterator.__anext__()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\utils.py", line 339, in __anext__
    return await anyio.to_thread.run_sync(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\anyio\_backends\_asyncio.py", line 2106, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\anyio\_backends\_asyncio.py", line 833, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\utils.py", line 322, in run_sync_iterator_async
    return next(iterator)
           ^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\utils.py", line 691, in gen_wrapper
    yield from f(*args, **kwargs)
  File "C:\Users\Naozu\Downloads\LLaMA-Factory-main\src\llmtuner\webui\chatter.py", line 63, in load_model
    super().__init__(args)
  File "C:\Users\Naozu\Downloads\LLaMA-Factory-main\src\llmtuner\chat\stream_chat.py", line 15, in __init__
    self.model, self.tokenizer = load_model_and_tokenizer(model_args, finetuning_args)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\Downloads\LLaMA-Factory-main\src\llmtuner\tuner\core\loader.py", line 71, in load_model_and_tokenizer
    tokenizer = AutoTokenizer.from_pretrained(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\models\auto\tokenization_auto.py", line 738, in from_pretrained
    return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\tokenization_utils_base.py", line 2017, in from_pretrained
    return cls._from_pretrained(
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\tokenization_utils_base.py", line 2249, in _from_pretrained
    tokenizer = cls(*init_inputs, **init_kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naozu/.cache\huggingface\modules\transformers_modules\chatglm3-6b-cantonese-stage1\tokenization_chatglm.py", line 93, in __init__
    super().__init__(padding_side=padding_side, clean_up_tokenization_spaces=clean_up_tokenization_spaces, **kwargs)
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\tokenization_utils.py", line 363, in __init__
    super().__init__(**kwargs)
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\tokenization_utils_base.py", line 1604, in __init__
    super().__init__(**kwargs)
  File "C:\Users\Naozu\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\tokenization_utils_base.py", line 861, in __init__
    setattr(self, key, value)
AttributeError: property 'eos_token' of 'ChatGLMTokenizer' object has no setter
@hiyouga
Copy link
Owner

hiyouga commented Oct 29, 2023

导出后的目录是什么样的

@hiyouga hiyouga added the pending This problem is yet to be addressed label Oct 29, 2023
@Naozumi520
Copy link
Author

config.json
configuration_chatglm.py
generation_config.json
modeling_chatglm.py
pytorch_model-00001-of-00002.bin
pytorch_model-00002-of-00002.bin
pytorch_model.bin.index.json
quantization.py
special_tokens_map.json
tokenization_chatglm.py
tokenizer.model
tokenizer_config.json

@hiyouga
Copy link
Owner

hiyouga commented Oct 29, 2023

看起来是 Windows 路径识别的问题

@Naozumi520
Copy link
Author

有辦法解決嗎

@Naozumi520
Copy link
Author

大佬在嗎, 我只能在windows下加載, 沒有其他辦法了

@hiyouga
Copy link
Owner

hiyouga commented Oct 30, 2023

建议使用 WSL

@hiyouga hiyouga added wontfix This will not be worked on and removed pending This problem is yet to be addressed labels Oct 30, 2023
@hiyouga hiyouga closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2023
@Naozumi520
Copy link
Author

Still, even installed ubuntu on my PC

Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:04<00:00,  1.50it/s]
10/30/2023 17:56:17 - INFO - llmtuner.tuner.core.adapter - Fine-tuning method: LoRA
10/30/2023 17:56:21 - INFO - llmtuner.tuner.core.adapter - Merged 1 model checkpoint(s).
10/30/2023 17:56:21 - INFO - llmtuner.tuner.core.adapter - Loaded fine-tuned model from checkpoint(s): saves/ChatGLM2-6B-Chat/lora/chatglm3_cantonese_pretraining_epoch3
10/30/2023 17:56:21 - INFO - llmtuner.tuner.core.loader - trainable params: 0 || all params: 6243584000 || trainable%: 0.0000
10/30/2023 17:56:21 - INFO - llmtuner.tuner.core.loader - This IS expected that the trainable params is 0 if you are using model for inference only.
10/30/2023 17:58:48 - WARNING - llmtuner.tuner.core.loader - Checkpoint is not found at evaluation, load the original model.
Traceback (most recent call last):
  File "/home/naozumi/.local/lib/python3.10/site-packages/gradio/routes.py", line 442, in run_predict
    output = await app.get_blocks().process_api(
  File "/home/naozumi/.local/lib/python3.10/site-packages/gradio/blocks.py", line 1389, in process_api
    result = await self.call_function(
  File "/home/naozumi/.local/lib/python3.10/site-packages/gradio/blocks.py", line 1108, in call_function
    prediction = await utils.async_iteration(iterator)
  File "/home/naozumi/.local/lib/python3.10/site-packages/gradio/utils.py", line 346, in async_iteration
    return await iterator.__anext__()
  File "/home/naozumi/.local/lib/python3.10/site-packages/gradio/utils.py", line 339, in __anext__
    return await anyio.to_thread.run_sync(
  File "/home/naozumi/.local/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "/home/naozumi/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2106, in run_sync_in_worker_thread
    return await future
  File "/home/naozumi/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 833, in run
    result = context.run(func, *args)
  File "/home/naozumi/.local/lib/python3.10/site-packages/gradio/utils.py", line 322, in run_sync_iterator_async
    return next(iterator)
  File "/home/naozumi/.local/lib/python3.10/site-packages/gradio/utils.py", line 691, in gen_wrapper
    yield from f(*args, **kwargs)
  File "/home/naozumi/下載/LLaMA-Factory-main/src/llmtuner/webui/chatter.py", line 63, in load_model
    super().__init__(args)
  File "/home/naozumi/下載/LLaMA-Factory-main/src/llmtuner/chat/stream_chat.py", line 15, in __init__
    self.model, self.tokenizer = load_model_and_tokenizer(model_args, finetuning_args)
  File "/home/naozumi/下載/LLaMA-Factory-main/src/llmtuner/tuner/core/loader.py", line 71, in load_model_and_tokenizer
    tokenizer = AutoTokenizer.from_pretrained(
  File "/home/naozumi/.local/lib/python3.10/site-packages/transformers/models/auto/tokenization_auto.py", line 652, in from_pretrained
    tokenizer_config = get_tokenizer_config(pretrained_model_name_or_path, **kwargs)
  File "/home/naozumi/.local/lib/python3.10/site-packages/transformers/models/auto/tokenization_auto.py", line 496, in get_tokenizer_config
    resolved_config_file = cached_file(
  File "/home/naozumi/.local/lib/python3.10/site-packages/transformers/utils/hub.py", line 417, in cached_file
    resolved_file = hf_hub_download(
  File "/home/naozumi/.local/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 110, in _inner_fn
    validate_repo_id(arg_value)
  File "/home/naozumi/.local/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 158, in validate_repo_id
    raise HFValidationError(
huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': '/home/naozumi/下載/chatglm2_cantonese'. Use `repo_type` argument if needed.

@aleSheng
Copy link

我用WSL也是有这个问题

@ganting
Copy link

ganting commented Oct 31, 2023

+1,也遇到这个问题,导出后,在 ubuntu 22.04 无法使用模型

image

FlashAttention-2 is not installed, ignore this if you are not using FlashAttention.
10/31/2023 14:53:23 - WARNING - llmtuner.tuner.core.loader - Checkpoint is not found at evaluation, load the original model.
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/doucai/.vscode-server/extensions/ms-python.python-2023.18.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py", line 39, in <module>
    cli.main()
  File "/home/doucai/.vscode-server/extensions/ms-python.python-2023.18.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
    run()
  File "/home/doucai/.vscode-server/extensions/ms-python.python-2023.18.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file
    runpy.run_path(target, run_name="__main__")
  File "/home/doucai/.vscode-server/extensions/ms-python.python-2023.18.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/home/doucai/.vscode-server/extensions/ms-python.python-2023.18.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/home/doucai/.vscode-server/extensions/ms-python.python-2023.18.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code
    exec(code, run_globals)
  File "/home/doucai/LLaMA-Factory/src/api_demo.py", line 14, in <module>
    main()
  File "/home/doucai/LLaMA-Factory/src/api_demo.py", line 7, in main
    chat_model = ChatModel()
  File "/home/doucai/LLaMA-Factory/src/llmtuner/chat/stream_chat.py", line 15, in __init__
    self.model, self.tokenizer = load_model_and_tokenizer(model_args, finetuning_args)
  File "/home/doucai/LLaMA-Factory/src/llmtuner/tuner/core/loader.py", line 71, in load_model_and_tokenizer
    tokenizer = AutoTokenizer.from_pretrained(
  File "/home/doucai/LLaMA-Factory/venv/lib/python3.10/site-packages/transformers/models/auto/tokenization_auto.py", line 738, in from_pretrained
    return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
  File "/home/doucai/LLaMA-Factory/venv/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 2017, in from_pretrained
    return cls._from_pretrained(
  File "/home/doucai/LLaMA-Factory/venv/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 2249, in _from_pretrained
    tokenizer = cls(*init_inputs, **init_kwargs)
  File "/home/doucai/.cache/huggingface/modules/transformers_modules/xhs_merge/tokenization_chatglm.py", line 93, in __init__
    super().__init__(padding_side=padding_side, clean_up_tokenization_spaces=clean_up_tokenization_spaces, **kwargs)
  File "/home/doucai/LLaMA-Factory/venv/lib/python3.10/site-packages/transformers/tokenization_utils.py", line 363, in __init__
    super().__init__(**kwargs)
  File "/home/doucai/LLaMA-Factory/venv/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 1604, in __init__
    super().__init__(**kwargs)
  File "/home/doucai/LLaMA-Factory/venv/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 861, in __init__
    setattr(self, key, value)
AttributeError: can't set attribute 'eos_token'

@hiyouga
Copy link
Owner

hiyouga commented Oct 31, 2023

把源目录除了 bin 和 pytorch_model.bin.index.json 以外的文件全部复制到导出目录中覆盖

@nansanhao
Copy link

nansanhao commented Dec 5, 2023

把源目录除了 bin 和 pytorch_model.bin.index.json 以外的文件全部复制到导出目录中覆盖

这里会导致报这个错误:THUDM/ChatGLM3#152 (comment)
@hiyouga

@ghx2757
Copy link

ghx2757 commented Dec 7, 2023

@ganting #1307 (comment) 请问你这个问题怎么解决的呢?

@ghx2757
Copy link

ghx2757 commented Dec 7, 2023

@nansanhao AttributeError: can't set attribute 'eos_token' 这个错误你是如何解决的?

@nansanhao
Copy link

@nansanhao AttributeError: can't set attribute 'eos_token' 这个错误你是如何解决的?

@ghx2757 复制原模型的tokenizer_config.json文件到新模型下,覆盖新模型的这个文件

@ghx2757
Copy link

ghx2757 commented Dec 7, 2023

@nansanhao AttributeError: can't set attribute 'eos_token' 这个错误你是如何解决的?

@ghx2757 复制原模型的tokenizer_config.json文件到新模型下,覆盖新模型的这个文件

我按照你所说的方式进行了tokenizer_config.json文件替换,但是模型的回复效果上和没有进行微调时一样,你有出现该问题吗?

@nansanhao
Copy link

@nansanhao AttributeError: can't set attribute 'eos_token' 这个错误你是如何解决的?

@ghx2757 复制原模型的tokenizer_config.json文件到新模型下,覆盖新模型的这个文件

我按照你所说的方式进行了tokenizer_config.json文件替换,但是模型的回复效果上和没有进行微调时一样,你有出现该问题吗?

我是全参数微调

@ghx2757
Copy link

ghx2757 commented Dec 7, 2023

@nansanhao AttributeError: can't set attribute 'eos_token' 这个错误你是如何解决的?

@ghx2757 复制原模型的tokenizer_config.json文件到新模型下,覆盖新模型的这个文件

我按照你所说的方式进行了tokenizer_config.json文件替换,但是模型的回复效果上和没有进行微调时一样,你有出现该问题吗?

我是全参数微调

好的,谢谢,我在看看吧..

@migrant620
Copy link

@nansanhao AttributeError: can't set attribute 'eos_token' 这个错误你是如何解决的?

@ghx2757 复制原模型的tokenizer_config.json文件到新模型下,覆盖新模型的这个文件

我按照你所说的方式进行了tokenizer_config.json文件替换,但是模型的回复效果上和没有进行微调时一样,你有出现该问题吗?

我是全参数微调

好的,谢谢,我在看看吧..

你好,请问下你这问题解决了吗?我也是照着作者的办法解决了加载的问题,但微调的结果在推理过程中失效了,这和在web demo中运行的结果不一样,本项目的web demo中加载后推理是能呈现微调效果的

@ghx2757
Copy link

ghx2757 commented Dec 8, 2023

@migrant620 #1307 (comment) 还没...还在解决中

@hiyouga
Copy link
Owner

hiyouga commented Dec 8, 2023

@migrant620 你需要加 system prompt

system=(
"You are ChatGLM3, a large language model trained by Zhipu.AI. "
"Follow the user's instructions carefully. Respond using markdown."
),

@ItsFated
Copy link

ItsFated commented Dec 9, 2023

@migrant620 你需要加 system prompt

system=(
"You are ChatGLM3, a large language model trained by Zhipu.AI. "
"Follow the user's instructions carefully. Respond using markdown."
),

新手提问,这个加System Prompt是直接改这段代码,还是说要修改Dataset增加系统提示词字段

@hiyouga
Copy link
Owner

hiyouga commented Dec 9, 2023

@migrant620
Copy link

@migrant620 你需要加 system prompt

system=(
"You are ChatGLM3, a large language model trained by Zhipu.AI. "
"Follow the user's instructions carefully. Respond using markdown."
),

@hiyouga 谢谢老师,这样的话就意味着每次提问都需要加role=system的指令了对吧,实际我想达到的效果是不经过system而通过微调方式改变模型的自我认知,这在glm二代是可以的

@hiyouga
Copy link
Owner

hiyouga commented Dec 11, 2023

@migrant620 你改的方法还是微调,我只是说让你在推理时候带上之前的 system prompt

@migrant620
Copy link

@migrant620 你改的方法还是微调,我只是说让你在推理时候带上之前的 system prompt

我改的是微调,比如我微调的语料就是为了改变他的自我认知。如果说推理时不带上system prompt的话,微调的结果现在看是没起作用

@mavisyyc
Copy link

@nansanhao AttributeError: can't set attribute 'eos_token' 这个错误你是如何解决的?

@ghx2757 复制原模型的tokenizer_config.json文件到新模型下,覆盖新模型的这个文件

我按照你所说的方式进行了tokenizer_config.json文件替换,但是模型的回复效果上和没有进行微调时一样,你有出现该问题吗?

我是全参数微调

好的,谢谢,我在看看吧..

你好,请问下你这问题解决了吗?我也是照着作者的办法解决了加载的问题,但微调的结果在推理过程中失效了,这和在web demo中运行的结果不一样,本项目的web demo中加载后推理是能呈现微调效果的

您好,请问您解决了吗?我也遇到了这问题

@GitYohoo
Copy link

@nansanhao AttributeError: can't set attribute 'eos_token' 这个错误你是如何解决的?

@ghx2757 复制原模型的tokenizer_config.json文件到新模型下,覆盖新模型的这个文件

我按照你所说的方式进行了tokenizer_config.json文件替换,但是模型的回复效果上和没有进行微调时一样,你有出现该问题吗?

我也是同样的问题

@xiabo0816
Copy link

我是精调chatglm3-6b-32k,也遇到了AttributeError: can't set attribute 'eos_token'的问题,解决方式是编辑tokenizer_config.json,删除其中的eos_tokenpad_tokenunk_token就可以了

@qianlongqf
Copy link

我是精调chatglm3-6b-32k,也遇到了AttributeError: can't set attribute 'eos_token'的问题,解决方式是编辑tokenizer_config.json,删除其中的eos_tokenpad_tokenunk_token就可以了

出现notImplementdError

@RENLINA123
Copy link

@migrant620 #1307 (comment) 还没...还在解决中

您好,请问这个问题有解决吗?

@xiaowuzicode
Copy link

我是精调chatglm3-6b-32k,也遇到了AttributeError: can't set attribute 'eos_token'的问题,解决方式是编辑tokenizer_config.json,删除其中的eos_tokenpad_tokenunk_token就可以了

不报错了,调完的没效果了,自我认知的

@RENLINA123
Copy link

把源目录除了 bin 和 pytorch_model.bin.index.json 以外的文件全部复制到导出目录中覆盖

@hiyouga 你好,将其他文件覆盖后导致微调没有效果,请问应该如何解决?

@snakecy
Copy link

snakecy commented Apr 25, 2024

同样的问题。property 'eos_token' of 'ChatGLMTokenizer'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved This problem has been already solved
Projects
None yet
Development

No branches or pull requests