THUDM / THUDM/slime

search-r1 reproduction apply_chat_template problem

Open
#1,376 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.5k
Forks
1.3k
Avg merge
5h 36m
Merged PRs (30d)
22

Description

I followed the instructions for Search-R1 exactly, but I encountered the following bug. Note: I did not change any code.

Status message: Job entrypoint command failed with exit code 1, last available logs (truncated to 20,000 chars):
    sample = await custom_generate_func(args, sample, sampling_params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/slime-main/examples/search-r1/generate_with_search.py", line 156, in generate
    assert isinstance(prompt, np.ndarray), "prompt should be a np.ndarray when apply_chat_template is True"
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Follow the Search-R1 instructions to reproduce the failure, then start in examples/search-r1/generate_with_search.py around line 156. Trace how prompt is produced before generate; done means the reproduction no longer fails the apply_chat_template assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.