Views
No views yet
train.jsonl) + 2,531 synthetic examples (synthetic.jsonl) upsampled 2x = 6,378 total1from peft import PeftModel
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")
5model = PeftModel.from_pretrained(base_model, "cometadata/funding-parsing-lora-Llama_3.1_8B-instruct-ep2-r128-a32-grpo")
6tokenizer = AutoTokenizer.from_pretrained("cometadata/funding-parsing-lora-Llama_3.1_8B-instruct-ep2-r128-a32-grpo")
7
8messages = [
9 {"role": "system", "content": "Extract funding information from the text. Return a JSON array of funders."},
10 {"role": "user", "content": "Extract funding information from the following statement:\n\nThis work was supported by the National Science Foundation (Grant No. 2045678) and the European Research Council (ERC-2021-StG-101039567)."}
11]
12
13inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
14outputs = model.generate(inputs, max_new_tokens=512, temperature=0.1)
15print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))1[
2 {
3 "funder_name": "National Science Foundation",
4 "awards": [
5 {
6 "award_ids": ["2045678"],
7 "funding_scheme": [],
8 "award_title": []
9 }
10 ]
11 },
12 {
13 "funder_name": "European Research Council",
14 "awards": [
15 {
16 "award_ids": ["ERC-2021-StG-101039567"],
17 "funding_scheme": [],
18 "award_title": []
19 }
20 ]
21 }
22]| Step | Eval Reward | Notes |
|---|---|---|
| 0 | 0.945 | SFT baseline |
| 20 | 0.957 | |
| 30 | 0.958 | |
| 50 | 0.960 | |
| 70 | 0.959 | Best checkpoint (this release) |
| 110 | 0.958 | |
| 217 | 0.950 | Final step |