THUDM / CodeGeeX4

CodeGeeX4-ALL-9B, a versatile model for all AI software development scenarios, including code completion, code interpreter, web search, function calling, repository-level Q&A and much more.
https://codegeex.cn
Apache License 2.0
1.43k stars 111 forks source link

completions not working #34

Open onewesong opened 3 months ago

onewesong commented 3 months ago

使用ollama本地运行codegeex4 请求补全的接口curl -s http://localhost:62333/v1/completions -d @/tmp/p3.json|jq .

image

请求的body

{
  "model": "codegeex4",
  "messages": [
    {
      "role": "user",
      "content": "###LANGUAGE:Python\n###MODE:BLOCK\n<|code_suffix|>\n<|code_prefix|>def parse_nested_parens(paren_string: str) -> List[int]:\n    \"\"\" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n    For each of the group, output the deepest level of nesting of parentheses.\n    E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n    >>> parse_nested_parens('(()()) ((())) () ((())()())')\n   [2, 3, 1, 3]\n\"\"\"\n<|code_middle|>"
    }
  ],
  "temperature": 0.2,
  "top_p": 0.95,
  "max_tokens": 64,
  "presence_penalty": 1,
  "stream": false,
  "stop": []
}

响应 "finish_reason": "load",没有生成text是何原因?

onewesong commented 3 months ago

对比starcode2:3b模型 image image 其中prompt 为vscode continue插件自动生成,使用项目文档里的方式构建提示词也不行(见issue)