Comments (8)
prompt = "// language: Java\n#write a bubble sort function\n" 你的prompt改错了,用这个可以正常返回
from codegeex2.
@yug2023 我个人的想法是这个prompt是写了两行注释 然后通过注释生成代码 所以我认为 prompt 应该是 "// language: Java\n //write a bubble sort function\n"
而且其他语言的prompt我也是按照这一想法修改的 都没有问题。 所以我不太清楚prompt的正确格式应该是什么样的。 你有尝试过其他语言只修改最前面的注释字符token。 @Stanislas0 您好,请问可以在这方面详细说明一下吗?
from codegeex2.
@yug2023 我个人的想法是这个prompt是写了两行注释 然后通过注释生成代码 所以我认为 prompt 应该是
"// language: Java\n //write a bubble sort function\n"
而且其他语言的prompt我也是按照这一想法修改的 都没有问题。 所以我不太清楚prompt的正确格式应该是什么样的。 你有尝试过其他语言只修改最前面的注释字符token。 @Stanislas0 您好,请问可以在这方面详细说明一下吗?
你的prompt没有写错,CodeGeeX2是一个基座模型,prompt格式就是按照正常编程习惯来写。这里出现空行比较奇怪,我试了是可以正常出东西的,估计是精度原因导致,不知道你的模型是否经过了量化。如果要更好的引导模型生成函数体,只需要再加上一些关键字就行了,比如“public”,模型就会继续完成函数体。
from codegeex2.
你好,我也是用java生成冒泡排序失败。两种prompt都尝试过,“// language: Java\n //write a bubble sort function\n”,“prompt = "// language: Java\n#write a bubble sort function\n"”。都是打印大量空行,没有任何内容。使用的是单卡32G V100,模型没有经过量化。
from codegeex2.
@toufunao Stanislas0 提到可能是模型精度问题。
你的prompt没有写错,CodeGeeX2是一个基座模型,prompt格式就是按照正常编程习惯来写。这里出现空行比较奇怪,我试了是可以正常出东西的,估计是精度原因导致,不知道你的模型是否经过了量化。如果要更好的引导模型生成函数体,只需要再加上一些关键字就行了,比如“public”,模型就会继续完成函数体。
V100机器不支持bfloat16,所以需要按照README中的教程修改代码
如果显卡不支持bfloat16格式,将会输出错误的内容,需要将模型转换成float16格式:
model = AutoModel.from_pretrained("THUDM/codegeex2-6b", trust_remote_code=True).half().cuda()
我没有进行尝试,如果你成功了希望你可以回复一下
from codegeex2.
@Zz-dong 你好,我刚刚尝试过了,可以输出Java代码,但仍存在大量的空行。
而且还会出现以下提示:“The attention mask and the pad token id were not set. As a sequence, you may observe unexpected behavior. Please pass your inputs's 'attention_mask' to obtain reliable results. Setting 'pad_token_id' to 'eos_token_id':2 for open-ended generation. ”
ps:
我下一步会考虑进行微调,有相关微调数据预处理的教程吗?
from codegeex2.
@toufunao 我似乎也遇到过这样的warning,或许这就是空行存在的原因,可以请教一下@Stanislas0 。 #47 和 #16 中都有提到微调的需求但是官方似乎没有提供相应的教程,这也是我的需求。希望官方可以更新一下,期待 !
from codegeex2.
我也出现了大量空行,还有warning提示
The attention mask and the pad token id were not set. As a consequence, you may observe unexpected behavior. Please pass your input's attention_mask
to obtain reliable results.
Setting pad_token_id
to eos_token_id
:2 for open-end generation.
并且原封不动的吧Prompt的内容打印出来,最奇怪的是代码一个字也没生成。我没有对模型进行量化。
from codegeex2.
Related Issues (20)
- 代码显示多行 HOT 2
- 安装不了怎么办
- 请问能弄个接口到openinterpreter吗
- [BUG] CodeGeeX提示和代码补全冲突 HOT 4
- 关于在Vscode中的使用问题。 HOT 1
- VSCode 下会导致 tsserver 报错,禁用后正常 HOT 2
- Mac 上 VSCode Extension "Ask CodeGeeX" 的问题输入框无法正常copy paste HOT 3
- VSCode扩展其他项目的问题带入到当前项目中
- ask codegeex Failed to fetch HOT 1
- 询问codegeex报错Failed to fetch HOT 2
- 解释javascript 存在变量提升逻辑错误
- vscode下不能提示,检查 inlineSuggest 配置
- 错误:AttributeError: 'ChatGLMTokenizer' object has no attribute 'tokenizer' HOT 4
- mac m1报错: AssertionError: Torch not compiled with CUDA enabled
- 可以支持在monaco-editor 中进行嵌入吗
- 用户可选择是否开启代码自动补全
- VS code跳转登录页面后无法验证 HOT 2
- 代码补全等的prompt要怎么写
- 用Ask问问题生成其他语言代码不太对 HOT 1
- CodeGeeX无法登录 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codegeex2.