用户求助让Gemma 4适配SWEBench评测
原文:How to make gemma 4 works with SWEBench?
我想对比 gemma 4 31b qat q4 和 qwen3.8 27b iq4_nl,于是我在它们上面运行了 SWEBench verified。原始的 gemma 4 聊天模板无法在保留推理的情况下工作,所以 Google 发布了一个更新,使其可以用于智能体编程:https://huggingface.co/google/gemma-4-31B-it/blob/main/chat_template.jinja 然而,当我通过 SWEBench verified 运行它时,我得到的所有结果都是 LimitExceeded 错误,而 Qwen3.8 27b iq4_nl 可以提交 388/500,其中 333/388 被解决。我尝试了网上流传的其他聊天模板:https://gist.github.com/jscott3201/ad69c4ffbd79f18b11a0f6a94c94fadf https://gist.github.com/bbrowning/c584eb2dbd79e4cc9ecedf92eee2d135 https://huggingface.co/stevelikesrhino/gemma-4-31B-it-nvfp4-GGUF/blob/main/gemma4-improved.jinja https://github.com/vllm-project/vllm/blob/main/examples/tool_chat_template_gemma4.jinja https://huggingface.co/google/gemma-4-31B-it/discussions/137 https://huggingface.co/google/gemma-4-31B-it/discussions/135 https://huggingface.co/ManniX-ITA/gemma-4-A4B-98e-v7-coder-it/blob/main/chat_template.jinja 但它们都有同样的问题。这是我的 llama-server 命令:./llama-server -m ~/gguf/gemma-4-31B_q4_0-it.gguf --jinja --chat-template-file chat_template.jinja -ngl 999 -fa 1 --load-mode mmap -np 1 --temp 1.0 --top_p 0.95 --top_k 64 --min_p 0.0 --presence-penalty 0.0 --repeat-penalty 1.0 -c 122880 -ctk q8_0 -ctv q8_0 --spec-type none --reasoning-preserve --host 192.168.1.140 --port 8080 --no-mmproj-offload --mmproj ~/gguf/gemma-4-31B-it-mmproj.gguf 我使用的 gguf 是 Google 的 QAT Q4。我也试过 unsloth 的 QAT,但同样报错。这是只运行四个测试的命令:swebench infer verified -c config.yaml -r gemma-4-31b-qat-q4_0-120k-q8_0 -m gemma-4-31b --filter "astropy__astropy-12907|astropy__astropy-13033|astropy__astropy-13977|astropy__astropy-13579" config.yaml model: cost_tracking: "ignore_errors" model_name: "my-local-model" mo