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

feat: Added Stream Chat; Added fp32, fp16 option for cpu with low mem #14

Merged
merged 2 commits into from
Mar 19, 2023

Conversation

haofanurusai
Copy link
Contributor

No description provided.

@haofanurusai haofanurusai changed the title Added fp32, fp16 option for cpu with low mem feat: Added Stream Chat; Added fp32, fp16 option for cpu with low mem Mar 19, 2023
model = model.float()
if cmd_opts.precision == "fp32":
model = model.float()
elif cmd_opts.precision == "fp16":
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bf16

else:
if cmd_opts.precision == "fp16":
model = model.half().cuda()
elif cmd_opts.precision == "int4":
model = model.half().quantize(4).cuda()
elif cmd_opts.precision == "int8":
model = model.half().quantize(8).cuda()
elif cmd_opts.precision == "fp32":
print("--precision ERROR: fp32 mode is only for CPU. Are you really ready to have such a large amount of vmem XD")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不需要报错,就直接按照参数加载

@Akegarasu
Copy link
Owner

另外最好提交到dev,算了我自己改吧

@Akegarasu Akegarasu merged commit 0bffa79 into Akegarasu:main Mar 19, 2023
@haofanurusai
Copy link
Contributor Author

好的 下次注意

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

Successfully merging this pull request may close these issues.

2 participants