From 8fe28101366dd32562b8c5534d7fe359b252bdf3 Mon Sep 17 00:00:00 2001 From: YurenHao0426 Date: Fri, 3 Apr 2026 15:12:34 -0500 Subject: Initial commit: UPH project codebase and experiment results Includes model code, evaluation scripts, configs, analysis outputs, and experiment results for the User Prior Head personalization method. Co-Authored-By: Claude Opus 4.6 (1M context) --- baselines/prompt_all_k.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 baselines/prompt_all_k.py (limited to 'baselines/prompt_all_k.py') diff --git a/baselines/prompt_all_k.py b/baselines/prompt_all_k.py new file mode 100644 index 0000000..5b132d8 --- /dev/null +++ b/baselines/prompt_all_k.py @@ -0,0 +1,12 @@ +"""Prompt-All-K baseline: put all K support items into the prompt as demonstrations.""" + +from data.templates import build_prompt_with_examples + + +def generate_prompt_all_k(wrapper, query_input: str, support_items: list, + task: str, max_new_tokens: int = 512, + temperature: float = 0.7, top_p: float = 0.9) -> str: + """Generate with all K support items in the prompt.""" + prompt = build_prompt_with_examples(query_input, support_items, task) + return wrapper.generate_base(prompt, max_new_tokens=max_new_tokens, + temperature=temperature, top_p=top_p) -- cgit v1.2.3