Views
No views yet
Qwen/Qwen2.5-7B-Instructqwen2_5_7b_lora16_sigbg_irred_red_v1, step 2200ho22joshua/hep-posttrainingho22joshua/hep-signature-backgrounds1from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
2from peft import PeftModel
3
4base_model_id = "Qwen/Qwen2.5-7B-Instruct"
5adapter_id = "ho22joshua/hep-qwen2.5-7b-lora16-sigbg-irred-red-step2200"
6
7tokenizer = AutoTokenizer.from_pretrained(adapter_id)
8model = AutoModelForCausalLM.from_pretrained(
9 base_model_id,
10 device_map="auto",
11 torch_dtype="auto",
12)
13model = PeftModel.from_pretrained(model, adapter_id)
14
15pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
16messages = [
17 {"role": "user", "content": "For a search targeting H to AA to photons, describe the signal signature and likely Standard Model backgrounds."}
18]
19prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
20print(pipe(prompt, max_new_tokens=300, do_sample=False)[0]["generated_text"])1python -m vllm.entrypoints.openai.api_server \
2 --model Qwen/Qwen2.5-7B-Instruct \
3 --enable-lora \
4 --lora-modules hep=ho22joshua/hep-qwen2.5-7b-lora16-sigbg-irred-red-step2200 \
5 --host 0.0.0.0 \
6 --port 8000 \
7 --dtype bfloat161curl http://localhost:8000/v1/chat/completions \
2 -H "Content-Type: application/json" \
3 -d '{
4 "model": "hep",
5 "messages": [
6 {"role": "user", "content": "For H to AA to photons, what backgrounds should be considered?"}
7 ],
8 "max_tokens": 300
9 }'