Downloads · 30 days
9
36% of all-time downloads
sssdddwd/AI_Governance_Fine_Tuned_mistral_7B_LLM
AI_Governance_Fine_Tuned_mistral_7B_LLM is a machine learning model from sssdddwd. 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.
This repository contains a fine-tuned version of the Mistral-7B-Instruct model trained on AI regulations data. The fine-tuning process utilized QLoRA (Quantized Low-Rank Adaptation) and BitsAndBytes 4-bit quantization…
Downloads · 30 days
9
36% of all-time downloads
All-time downloads
25
Public
Repo size
552 MB
Likes
0
Public
Click a slice to open those files.
.safetensors1.1 GB · 100%
From the Hugging Face model README
This repository contains a fine-tuned version of the Mistral-7B-Instruct model trained on AI regulations data. The fine-tuning process utilized QLoRA (Quantized Low-Rank Adaptation) and BitsAndBytes 4-bit quantization to optimize memory efficiency while preserving performance.
You can use the fine-tuned model for text generation using the Hugging Face Transformers library.
pip install transformers torch bitsandbytes accelerate
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_NAME = "sssdddwd/AI_Governance_Fine_Tuned_mistral_7B_LLM"
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
# Load model
model = AutoModelForCausalLM.from_pretrained(MODEL_NAME, torch_dtype=torch.float16, device_map="auto")
# Resize embeddings to match tokenizer
model.resize_token_embeddings(len(tokenizer))
# Set model to evaluation mode
model.eval()
def generate_response(prompt, max_length=256):
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_length=max_length)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
return response
# Example Usage
prompt = "What are the key AI regulations in the EU?"
response = generate_response(prompt)
print(response)
This model follows the same licensing as Mistral-7B. Please refer to the official Mistral AI terms for usage restrictions.
For any questions or issues, feel free to reach out via Hugging Face discussions!