override approach if set in messages

This commit is contained in:
Asankhaya Sharma
2024-10-22 07:45:42 +08:00
parent 0df52917a4
commit 94fad7846e
2 changed files with 3 additions and 3 deletions

View File

@@ -288,11 +288,10 @@ def proxy():
system_prompt, initial_query, message_optillm_approach = parse_conversation(messages)
# Use optillm_approach from extra_body if present, otherwise use from messages
if not optillm_approach and message_optillm_approach:
if message_optillm_approach:
optillm_approach = message_optillm_approach
if optillm_approach:
if optillm_approach != "auto":
model = f"{optillm_approach}-{model}"
base_url = server_config['base_url']

View File

@@ -18,6 +18,7 @@ def best_of_n_sampling(system_prompt: str, initial_query: str, client, model: st
temperature=1
)
completions = [choice.message.content for choice in response.choices]
logger.info(f"Generated {len(completions)} initial completions. Tokens used: {response.usage.completion_tokens}")
bon_completion_tokens += response.usage.completion_tokens
# Rate the completions