Views
No views yet
Qwen/Qwen2.5-7B-Instruct| Metric | Final Test |
|---|---|
| Execution Accuracy | 66.17% |
| Program Accuracy | 61.64% |
| Parse Success | 97.82% |
| Average Latency | 0.4793 s/example |
epoch_1_adapter1question
2+ pre_text
3+ table
4+ post_text
5 ↓
6FinQA programqa.programS2_financial_analyst_operation_reader.json1rank: 64
2alpha: 32
3dropout: 0.05
4bias: none
5task type: CAUSAL_LM1q_proj
2k_proj
3v_proj
4o_proj
5gate_proj
6up_proj
7down_proj1learning rate: 1e-4
2effective batch size: 32
3training dtype: bfloat161Training time: 14.7519 hours
2Training cost: approximately $27.88pip install torch transformers peft accelerate safetensors1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3from peft import PeftModel
4
5BASE_MODEL = "Qwen/Qwen2.5-7B-Instruct"
6ADAPTER = "Mr-Rosen/Accuracy-Is-Not-Enough-FinQA-LoRA"
7
8tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
9
10base_model = AutoModelForCausalLM.from_pretrained(
11 BASE_MODEL,
12 torch_dtype=torch.bfloat16,
13 device_map="auto",
14)
15
16model = PeftModel.from_pretrained(
17 base_model,
18 ADAPTER,
19)
20
21model.eval()S2_financial_analyst_operation_reader prompt.1qa.question
2pre_text
3table
4post_text1qa.program
2qa.exe_ans
3qa.gold_indsrendered_prompt has been constructed with the official prompt:1inputs = tokenizer(
2 rendered_prompt,
3 return_tensors="pt",
4).to(model.device)
5
6with torch.no_grad():
7 output = model.generate(
8 **inputs,
9 max_new_tokens=256,
10 do_sample=False,
11 )
12
13generated = output[0, inputs["input_ids"].shape[-1]:]
14
15text = tokenizer.decode(
16 generated,
17 skip_special_tokens=True,
18)
19
20print(text)["subtract(", "5829", "5735", ")", "EOF"]1[
2 {
3 "id": "example-id",
4 "predicted": [
5 "subtract(",
6 "5829",
7 "5735",
8 ")",
9 "EOF"
10 ]
11 }
12]Mr-Rosen/Accuracy-Is-Not-Enough-FinQA-DatasetMarkPaulRosenthal/Accuracy-Is-Not-Enough-Practical-Financial-QA