Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lcb_runner/prompts/code_generation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import os

try:
from anthropic import HUMAN_PROMPT, AI_PROMPT
Expand Down Expand Up @@ -264,8 +265,13 @@ def format_prompt_generation(
]
from transformers import AutoTokenizer

# The tokenizer is only used to render the Llama 3 chat template. The default repo is gated, so any
# Llama 3 family checkpoint the user can access (same chat template) may be substituted via
# LCB_LLAMA3_TOKENIZER.
tokenizer = AutoTokenizer.from_pretrained(
"meta-llama/Meta-Llama-3-8B-Instruct", padding_side="left", use_fast=False
os.environ.get("LCB_LLAMA3_TOKENIZER", "meta-llama/Meta-Llama-3-8B-Instruct"),
padding_side="left",
use_fast=False,
)
return tokenizer.apply_chat_template(
chat_messages,
Expand Down