Downloads · 30 days
17
8% of all-time downloads
TimberGu/Llama_for_Finance
Llama_for_Finance is a text generation model from TimberGu. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
A financial-domain instruction-tuned LoRA adapter for meta-llama/Meta-Llama-3.1-8B-Instruct, trained with length-aware batching and an English-only heuristic.
Downloads · 30 days
17
8% of all-time downloads
All-time downloads
202
Public
Repo size
873 MB
Likes
1
Public
Click a slice to open those files.
.safetensors671 MB · 97%
From the Hugging Face model README
A financial-domain instruction-tuned LoRA adapter for meta-llama/Meta-Llama-3.1-8B-Instruct, trained with length-aware batching and an English-only heuristic.
group_by_length=True, boundaries 512/1024/1536/2048)Josephgflowers/Finance-Instruct-500ktext field with system/user/assistant turnsmin_english_ratio≈0.85, min_chars_for_lang_check=40)from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base = "meta-llama/Meta-Llama-3.1-8B-Instruct"
adapter = "TimberGu/Llama_for_Finance"
tokenizer = AutoTokenizer.from_pretrained(adapter)
tokenizer.pad_token = tokenizer.eos_token
tokenizer.padding_side = "right" # matches training setup
dtype = torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16
base_model = AutoModelForCausalLM.from_pretrained(base, dtype=dtype, device_map="auto")
model = PeftModel.from_pretrained(base_model, adapter)
model.eval()
prompt = "Explain what a yield curve inversion implies for equities."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=256, temperature=0.8, top_p=0.9)
print(tokenizer.decode(out[0], skip_special_tokens=True))
eval_50_gpt_judged_raw.jsonl): eval_loss ≈1.05 over 2 epochs. No public benchmark beyond the filtered split.adapter_model.safetensors, adapter_config.json: LoRA weights/configtokenizer.json, tokenizer_config.json, special_tokens_map.json, chat_template.jinjatraining_config.json, training_args.bin, test_results.json