Skip to content

Commit

Permalink
Fix role
Browse files Browse the repository at this point in the history
  • Loading branch information
ProbablyFaiz committed Jun 19, 2024
1 parent c9d32a4 commit de4fcf0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion rl/llm/engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,13 @@ def _convert_openai_to_gemini(
prompt = prompt[:-1]
return (
system_prompt,
[{"role": msg["role"], "parts": [msg["content"]]} for msg in prompt],
[
{
"role": "model" if msg["role"] == "assistant" else msg["role"],
"parts": [msg["content"]],
}
for msg in prompt
],
last_message,
)

Expand Down

0 comments on commit de4fcf0

Please sign in to comment.