Downloads · 30 days
5
5% of all-time downloads
Idrissa242/Mistral-7B-Chemical-NER
Mistral-7B-Chemical-NER is a machine learning model from Idrissa242. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
A LoRA-adapted version of Mistral-7B-Instruct-v0.1 trained to act as a lightweight chemical/biomedical judge (scoring or classifying completions given a prompt) using a simple prompt → completion JSONL dataset. The mo…
Downloads · 30 days
5
5% of all-time downloads
All-time downloads
105
Public
Repo size
1 GB
Likes
0
Public
Click a slice to open those files.
.pt672 MB · 57%
From the Hugging Face model README
A LoRA-adapted version of Mistral-7B-Instruct-v0.1 trained to act as a lightweight chemical/biomedical judge (scoring or classifying completions given a prompt) using a simple prompt → completion JSONL dataset. The model is intended to evaluate or label biomedical-related text outputs rather than generate long-form content.
This model fine-tunes the base Mistral-7B-Instruct-v0.1 with LoRA adapters (PEFT) on a JSONL dataset of pairs: prompt: the instruction/context to judge completion: the desired judged output/label/explanation Only the completion segment contributes to the loss (the prompt tokens are masked with -100), matching your training script’s supervision scheme. The result is a parameter-efficient adapter suitable for inference on commodity GPUs with 8-bit base weights.
As a judge/evaluator for chemical-related text outputs: given a prompt (task/context) and a candidate answer, the model produces a concise judgment/label/score rationale depending on how you format your prompt.
Incorporate the LoRA adapter in a larger pipeline that generates candidates and then ranks/filters them using this judge.
Hallucinations: As a generative LM, it may produce confident but incorrect judgments. Domain bias: Behavior reflects the distribution and labeling of your training data. Ambiguity sensitivity: Judgments may vary with small prompt changes; provide clear, structured prompts. Security / Safety: Do not rely on the model for hazardous chemical substance guidance.
Use the code below to get started with the model.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
base = "mistralai/Mistral-7B-Instruct-v0.1"
adapter_dir = "judge_llama_lora" # your trained output dir
tok = AutoTokenizer.from_pretrained(base, use_fast=False)
if tok.pad_token is None:
tok.pad_token = tok.eos_token
base_model = AutoModelForCausalLM.from_pretrained(
base,
load_in_8bit=True, # matches training recipe
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, adapter_dir)
model.config.pad_token_id = tok.eos_token_id
prompt = "### Instruction:\nEvaluate the following chemical statement...\n### Candidate:\n..."
inputs = tok(prompt, return_tensors="pt").to(model.device)
with torch.inference_mode():
out = model.generate(**inputs, max_new_tokens=128)
print(tok.decode(out[0], skip_special_tokens=True))
Tokenized with AutoTokenizer.from_pretrained(base_model, use_fast=False) pad_token set to eos_token Fixed max_length = 128 with truncation/padding to max length.
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]