Skip to content

怎么在infer的时候传system prompt? #3950

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

Open
mxw20010804 opened this issue Apr 21, 2025 · 3 comments
Open

怎么在infer的时候传system prompt? #3950

mxw20010804 opened this issue Apr 21, 2025 · 3 comments

Comments

@mxw20010804
Copy link

{"problem": "Given that \begin{align*}x_{1}&=211,\\ x_{2}&=375,\\ x_{3}&=420,\\ x_{4}&=523,\ \text{and}\\ x_{n}&=x_{n-1}-x_{n-2}+x_{n-3}-x_{n-4}\ \text{when}\ n\geq5, \end{align*}find the value of $x_{531}+x_{753}+x_{975}$.", "solution": "Shifting the recurrence over by one and adding, we have: \[\begin{aligned} x_n &= x_{n-1} - x_{n-2} + x_{n-3} - x_{n-4} \\ x_{n-1} &= x_{n-2} - x_{n-3} + x_{n-4} - x_{n-5} \\ \implies x_n + x_{n-1} &= x_{n-1} - x_{n-5} \end{aligned}\]so $x_n = -x_{n-5}$ for all $n.$ In particular, $x_n = -x_{n-5} = -(-x_{n-10}) = x_{n-10},$ so the sequence repeats with period $10.$ Thus, \[\begin{aligned} x_{531} + x_{753} + x_{975} &= x_1 + x_3 + x_5 \\ &= x_1 + x_3 + (x_4-x_3+x_2-x_1) \\ &= x_2 + x_4 \\ &= 375 + 523 = \boxed{898}. \end{aligned}\]", "answer": "898", "subject": "Intermediate Algebra", "level": 4, "unique_id": "test/intermediate_algebra/90.json"}

system prompt的格式应该怎么组织呢??训练的格式是无法进行infer的。

@Jintao-Huang
Copy link
Collaborator

swift infer命令行跑就可以了 --val_dataset <dataset-path>

@Jintao-Huang
Copy link
Collaborator

Jintao-Huang commented Apr 23, 2025

如果使用python(例如:PtEngine, VllmEngine),需要组织成messages格式

@chenminupup
Copy link

如果使用python(例如:PtEngine, VllmEngine),需要组织成messages格式

想问下,如果想在推理的时候重新组织system-prompt,message的格式是什么样的呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants