Downloads · 30 days
11
5% of all-time downloads
Pepisxd/codellama-edugen-v2
codellama-edugen-v2 is a text generation model from Pepisxd. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as llama2.
Adapter LoRA/QLoRA para CodeLlama-7b-Instruct-hf, especializado en generar ejercicios educativos de Python para ciencia de datos con formato estructurado.
Downloads · 30 days
11
5% of all-time downloads
All-time downloads
223
Public
Repo size
304 MB
Likes
0
Public
Click a slice to open those files.
.safetensors269 MB · 71%
From the Hugging Face model README
Adapter LoRA/QLoRA para CodeLlama-7b-Instruct-hf, especializado en generar ejercicios educativos de Python para ciencia de datos con formato estructurado.
Este modelo fue afinado para producir salidas con formato educativo consistente:
## OBJETIVO## DATASET## CODIGO## EXPLICACIONEnfocado en ejercicios de pandas/numpy/matplotlib, en español, con dataset sintético local (rows) y sin lecturas de archivos.
llama2)codellama/CodeLlama-7b-Instruct-hfGeneración de ejercicios educativos de Python para práctica guiada en backend/API.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
from peft import PeftModel
base_model = "codellama/CodeLlama-7b-Instruct-hf"
adapter_path = "TU_USUARIO/codellama-edugen-v2"
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype=torch.float16,
)
tokenizer = AutoTokenizer.from_pretrained(adapter_path)
if tokenizer.pad_token is None and tokenizer.eos_token is not None:
tokenizer.pad_token = tokenizer.eos_token
model = AutoModelForCausalLM.from_pretrained(
base_model,
device_map="auto",
torch_dtype=torch.float16,
quantization_config=bnb_config,
)
model = PeftModel.from_pretrained(model, adapter_path)
model.eval()