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

[Bug]: 示例程序出错 #8725

Closed
1 task done
echo0218 opened this issue Jul 8, 2024 · 4 comments
Closed
1 task done

[Bug]: 示例程序出错 #8725

echo0218 opened this issue Jul 8, 2024 · 4 comments
Assignees
Labels
bug Something isn't working stale

Comments

@echo0218
Copy link

echo0218 commented Jul 8, 2024

软件环境

- paddlepaddle:3.0.0b0
- paddlepaddle-gpu: 
- paddlenlp: 3.0.0b0.post0

重复问题

  • I have searched the existing issues

错误描述

示例程序第三行报错:
Exception has occurred: AttributeError
module 'mmap' has no attribute 'MAP_PRIVATE'

稳定复现步骤 & 代码

from paddlenlp.transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2-0.5B")
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2-0.5B", dtype="float16")
input_features = tokenizer("你好!请自我介绍一下。", return_tensors="pd")
outputs = model.generate(**input_features, max_length=128)
tokenizer.batch_decode(outputs[0])
['我是一个AI语言模型,我可以回答各种问题,包括但不限于:天气、新闻、历史、文化、科学、教育、娱乐等。请问您有什么需要了解的吗?']

@echo0218 echo0218 added the bug Something isn't working label Jul 8, 2024
@DrownFish19
Copy link
Collaborator

非常抱歉出现这个问题,问题原因现已确定,修改PR为#8734 (暂未合入),辛苦参照修改内容进行修改。

具体原因:mmap在windows和unix上存在两种API,其中windows api不支持flag传入。

Windows: mmap(fileno, length[, tagname[, access[, offset]]])
Unix: mmap(fileno, length[, flags[, prot[, access[, offset]]]])

@echo0218
Copy link
Author

echo0218 commented Jul 9, 2024

#8734 修改了文件代码,示例代码仍出错。不再报mmap错误,新错误是:
Exception has occurred: PermissionError
[WinError 5] 拒绝访问。
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2-0.5B", dtype="float16")

Copy link

github-actions bot commented Sep 8, 2024

This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。

@github-actions github-actions bot added the stale label Sep 8, 2024
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants