Views
No views yet
1from transformers import AutoTokenizer, AutoModelForCausalLM
2from peft import PeftModel
3import torch
4
5# Load base model and tokenizer
6base_model = AutoModelForCausalLM.from_pretrained(
7 "Groq/Llama-3-Groq-8B-Tool-Use",
8 torch_dtype=torch.float16,
9 device_map="auto"
10)
11tokenizer = AutoTokenizer.from_pretrained("Groq/Llama-3-Groq-8B-Tool-Use")
12
13# Load LoRA adapter
14model = PeftModel.from_pretrained(base_model, "axk962/llama3-groq-hpc-energy-analysis")
15
16# Example usage
17prompt = "Find the top 3 science domains with highest energy consumption"
18inputs = tokenizer(prompt, return_tensors="pt")
19outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.1)
20response = tokenizer.decode(outputs[0], skip_special_tokens=True)
21
22Training Configuration
23
24Epochs: 10
25Batch Size: 1 (gradient accumulation: 8)
26Learning Rate: 2e-4
27Optimizer: AdamW with warmup
28Precision: FP16
29
30Citation
31
32@misc{llama3-groq-hpc-lora,
33 title={Llama-3-Groq-8B LoRA for EPIC: Accelerated Operational Analytics},
34 author={""},
35 year={2025},
36 url={https://huggingface.co/axk962/llama3-groq-hpc-energy-analysis}
37}