Downloads · 30 days
14
22% of all-time downloads
Pritish92/ner-grit-llama31-8b-lora-latest
ner-grit-llama31-8b-lora-latest is a text generation model from Pritish92. Use it when you need the model to write or continue text. It is set up for peft.
This is a GRIT + LoRA adapter fine-tuned from meta-llama/Llama-3.1-8B to do instruction-following NER-style extraction into a strict JSON list format:
Downloads · 30 days
14
22% of all-time downloads
All-time downloads
65
Public
Repo size
185 MB
Likes
0
Public
Click a slice to open those files.
.safetensors168 MB · 91%
From the Hugging Face model README
This is a GRIT + LoRA adapter fine-tuned from meta-llama/Llama-3.1-8B to do instruction-following NER-style extraction into a strict JSON list format:
[{"label":"...","text":"..."}]
Note: This repository contains adapter weights only (not the full base model weights). You must have access to meta-llama/Llama-3.1-8B on Hugging Face to run it.
### Instruction:
{instruction}
Maintain the JSON key order exactly as shown.
Output format: [{"label":"...","text":"..."}]
### Input:
{input_chunk}
### Response:
import torch
from peft import AutoPeftModelForCausalLM
from transformers import AutoTokenizer
adapter_id = "Pritish92/ner-grit-llama31-8b-lora-latest"
tokenizer = AutoTokenizer.from_pretrained(adapter_id, use_fast=True)
tokenizer.pad_token = tokenizer.eos_token
tokenizer.padding_side = "left"
tokenizer.truncation_side = "left"
model = AutoPeftModelForCausalLM.from_pretrained(
adapter_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
model.eval()
max_length): 20Local CSVs:
NER/NER-Data/ner_train_dataset.csvNER/NER-Data/ner_dev_dataset.csvNER/NER-Data/ner_test_dataset.csvExample counts: raw train=18,115, raw val=2,010; after chunking train examples=24,620
meta-llama/Llama-3.1-8B is gated, you must authenticate to download it.