-
Notifications
You must be signed in to change notification settings - Fork 521
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
使用Java语言编写冒泡排序,出现问题 #29
Comments
prompt = "// language: Java\n#write a bubble sort function\n" 你的prompt改错了,用这个可以正常返回 |
@yug2023 我个人的想法是这个prompt是写了两行注释 然后通过注释生成代码 所以我认为 prompt 应该是 |
你的prompt没有写错,CodeGeeX2是一个基座模型,prompt格式就是按照正常编程习惯来写。这里出现空行比较奇怪,我试了是可以正常出东西的,估计是精度原因导致,不知道你的模型是否经过了量化。如果要更好的引导模型生成函数体,只需要再加上一些关键字就行了,比如“public”,模型就会继续完成函数体。 |
你好,我也是用java生成冒泡排序失败。两种prompt都尝试过,“// language: Java\n //write a bubble sort function\n”,“prompt = "// language: Java\n#write a bubble sort function\n"”。都是打印大量空行,没有任何内容。使用的是单卡32G V100,模型没有经过量化。 |
@toufunao Stanislas0 提到可能是模型精度问题。
V100机器不支持bfloat16,所以需要按照README中的教程修改代码
model = AutoModel.from_pretrained("THUDM/codegeex2-6b", trust_remote_code=True).half().cuda() 我没有进行尝试,如果你成功了希望你可以回复一下 |
@Zz-dong 你好,我刚刚尝试过了,可以输出Java代码,但仍存在大量的空行。 ps: |
@toufunao 我似乎也遇到过这样的warning,或许这就是空行存在的原因,可以请教一下@Stanislas0 。 #47 和 #16 中都有提到微调的需求但是官方似乎没有提供相应的教程,这也是我的需求。希望官方可以更新一下,期待 ! |
我的显卡不支持bfloat16,也出现了大量空行,输出的啥也不是 |
我尝试使用Python、Java、Javascript、Ruby、Go、PHP语言编写冒泡排序。我按照README使用每个语言各自注释风格编写prompt。只有Java语言出现问题,其他语言正常。代码如下:
结果为没有任何输出
不知道有人是否遇到相同的问题
The text was updated successfully, but these errors were encountered: