Downloads · 30 days
0
baulab/elm-Meta-Llama-3-8B-Instruct
elm-Meta-Llama-3-8B-Instruct is a text generation model from baulab. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Erasing Conceptual Knoweldge from Language Models, Rohit Gandikota, Sheridan Feucht, Samuel Marks, David Bau
Downloads · 30 days
0
Access
Public
Updated Mar 25, 2025
Repo size
336 MB
Likes
0
Public
Click a slice to open those files.
.safetensors336 MB · 97%
From the Hugging Face model README
Erasing Conceptual Knoweldge from Language Models,
Rohit Gandikota, Sheridan Feucht, Samuel Marks, David Bau
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "baulab/elm-Meta-Llama-3-8B-Instruct"
device = 'cuda:0'
dtype = torch.float32
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=dtype)
model = model.to(device)
model.requires_grad_(False)
tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=False)
# generate text
inputs = tokenizer(prompt, return_tensors='pt', padding=True)
inputs = inputs.to(device).to(dtype)
outputs = model.generate(**inputs,
max_new_tokens=300,
do_sample=True,
top_p=.95,
temperature=1.2)
outputs = tokenizer.batch_decode(outputs, skip_special_tokens = True)
print(outputs[0])
<!-- Provide a quick summary of what the model is/does. -->
BibTeX:
@article{gandikota2024elm,
title={Erasing Conceptual Knowledge from Language Models},
author={Rohit Gandikota and Sheridan Feucht and Samuel Marks and David Bau},
journal={arXiv preprint arXiv:2410.02760},
year={2024}
}