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] moss_llm没有实现 #447

Closed
liaoweiguo opened this issue May 23, 2023 · 10 comments
Closed

[BUG] moss_llm没有实现 #447

liaoweiguo opened this issue May 23, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@liaoweiguo
Copy link

有些方法没支持,如history_len

下面的代码估计是从其他模型copy的,没改完,估计没有人测试过

@property
def set_history_len(self) -> int:
    return self.history_len

def _set_history_len(self, history_len: int) -> None:
    self.history_len = history_len
@liaoweiguo liaoweiguo added the bug Something isn't working label May 23, 2023
@zhiqix
Copy link

zhiqix commented May 25, 2023

确实

@zhuanke
Copy link

zhuanke commented May 31, 2023

我也遇到了,单独下载完moss模型,加载了10多分钟后,就报错了了

@zhiqix
Copy link

zhiqix commented May 31, 2023

我做了一些修改,可以运行了,后续可以传上来

@imClumsyPanda
Copy link
Collaborator

之前的moss实现也是网友提交pr上来的,手头暂时没有测试环境,如果有兴趣的话,欢迎发起PR到dev分支,非常感谢🙏

@dxysharon
Copy link

需要改动两处:
1.def _history_len(self) -> int:
return self.history_len

def set_history_len(self, history_len: int) -> None:
self.history_len = history_len
2.tokenizer出现的地方都改为这个self.checkPoint.tokenizer
但是之后还是会提示
Setting pad_token_id to eos_token_id:106068 for open-end generation.
有时候可以加载进来,有时候不行提示RuntimeError: Expected all tensors to be on the same device, but found at least two devices

@zhiqix
Copy link

zhiqix commented Jun 2, 2023

Expected all tensors to be on the same device, but found at least two devices

指定device,把数据和模型都放到一个device上就行

@zhiqix
Copy link

zhiqix commented Jun 2, 2023

需要改动两处: 1.def _history_len(self) -> int: return self.history_len

def set_history_len(self, history_len: int) -> None: self.history_len = history_len 2.tokenizer出现的地方都改为这个self.checkPoint.tokenizer 但是之后还是会提示 Setting pad_token_id to eos_token_id:106068 for open-end generation. 有时候可以加载进来,有时候不行提示RuntimeError: Expected all tensors to be on the same device, but found at least two devices

另外”Setting pad_token_id to eos_token_id:106068 for open-end generation. “,这个提示是正常现象,该有的

@dxysharon
Copy link

Expected all tensors to be on the same device, but found at least two devices

指定device,把数据和模型都放到一个device上就行
大佬,请问可以在参数里指定吗还是需要在代码里改呀

@zhiqix
Copy link

zhiqix commented Jun 2, 2023

Expected all tensors to be on the same device, but found at least two devices

指定device,把数据和模型都放到一个device上就行
大佬,请问可以在参数里指定吗还是需要在代码里改呀

在代码里改,把模型和数据.to(device)里,然后MOSS的prompt还需要加上一个尾标:
image

@rDearApple
Copy link

Expected all tensors to be on the same device, but found at least two devices

指定device,把数据和模型都放到一个device上就行
大佬,请问可以在参数里指定吗还是需要在代码里改呀

在代码里改,把模型和数据.to(device)里,然后MOSS的prompt还需要加上一个尾标: image
请问加这个尾标有什么作用 谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants