Instructions to use RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf", filename="PII-Model-Phi3-Mini.IQ3_M.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf:Q4_K_M
Use Docker
docker model run hf.co/RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf with Ollama:
ollama run hf.co/RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf:Q4_K_M
- Unsloth Studio new
How to use RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf to start chatting
- Docker Model Runner
How to use RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf with Docker Model Runner:
docker model run hf.co/RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf:Q4_K_M
- Lemonade
How to use RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull RichardErkhov/ab-ai_-_PII-Model-Phi3-Mini-gguf:Q4_K_M
Run and chat with the model
lemonade run user.ab-ai_-_PII-Model-Phi3-Mini-gguf-Q4_K_M
List all available models
lemonade list
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Quantization made by Richard Erkhov.
PII-Model-Phi3-Mini - GGUF
- Model creator: https://huggingface.co/ab-ai/
- Original model: https://huggingface.co/ab-ai/PII-Model-Phi3-Mini/
| Name | Quant method | Size |
|---|---|---|
| PII-Model-Phi3-Mini.Q2_K.gguf | Q2_K | 1.32GB |
| PII-Model-Phi3-Mini.IQ3_XS.gguf | IQ3_XS | 1.51GB |
| PII-Model-Phi3-Mini.IQ3_S.gguf | IQ3_S | 1.57GB |
| PII-Model-Phi3-Mini.Q3_K_S.gguf | Q3_K_S | 1.57GB |
| PII-Model-Phi3-Mini.IQ3_M.gguf | IQ3_M | 1.73GB |
| PII-Model-Phi3-Mini.Q3_K.gguf | Q3_K | 1.82GB |
| PII-Model-Phi3-Mini.Q3_K_M.gguf | Q3_K_M | 1.82GB |
| PII-Model-Phi3-Mini.Q3_K_L.gguf | Q3_K_L | 1.94GB |
| PII-Model-Phi3-Mini.IQ4_XS.gguf | IQ4_XS | 1.93GB |
| PII-Model-Phi3-Mini.Q4_0.gguf | Q4_0 | 2.03GB |
| PII-Model-Phi3-Mini.IQ4_NL.gguf | IQ4_NL | 2.04GB |
| PII-Model-Phi3-Mini.Q4_K_S.gguf | Q4_K_S | 2.04GB |
| PII-Model-Phi3-Mini.Q4_K.gguf | Q4_K | 2.23GB |
| PII-Model-Phi3-Mini.Q4_K_M.gguf | Q4_K_M | 2.23GB |
| PII-Model-Phi3-Mini.Q4_1.gguf | Q4_1 | 2.24GB |
| PII-Model-Phi3-Mini.Q5_0.gguf | Q5_0 | 2.46GB |
| PII-Model-Phi3-Mini.Q5_K_S.gguf | Q5_K_S | 2.46GB |
| PII-Model-Phi3-Mini.Q5_K.gguf | Q5_K | 2.62GB |
| PII-Model-Phi3-Mini.Q5_K_M.gguf | Q5_K_M | 2.62GB |
| PII-Model-Phi3-Mini.Q5_1.gguf | Q5_1 | 2.68GB |
| PII-Model-Phi3-Mini.Q6_K.gguf | Q6_K | 2.92GB |
| PII-Model-Phi3-Mini.Q8_0.gguf | Q8_0 | 3.78GB |
Original model description:
license: mit language: - en pipeline_tag: text-generation tags: - LLM - token classification - nlp - safetensor - PyTorch base_model: microsoft/Phi-3-mini-4k-instruct library_name: transformers widget: - text: My name is Sylvain and I live in Paris example_title: Parisian - text: My name is Sarah and I live in London example_title: Londoner
PII Detection Model - Phi3 Mini Fine-Tuned
This repository contains a fine-tuned version of the Phi3 Mini model for detecting personally identifiable information (PII). The model has been specifically trained to recognize various PII entities in text, making it a powerful tool for tasks such as data redaction, privacy protection, and compliance with data protection regulations.
Model Overview
Model Architecture
- Base Model: Phi3 Mini
- Fine-Tuned For: PII detection
- Framework: Hugging Face Transformers
Detected PII Entities
The model is capable of detecting the following PII entities:
Personal Information:
firstnamemiddlenamelastnamesexdob(Date of Birth)agegenderheighteyecolor
Contact Information:
emailphonenumberurlusernameuseragent
Address Information:
streetcitystatecountyzipcodecountrysecondaryaddressbuildingnumberordinaldirection
Geographical Information:
nearbygpscoordinate
Organizational Information:
companynamejobtitlejobareajobtype
Financial Information:
accountnameaccountnumbercreditcardnumbercreditcardcvvcreditcardissueribanbiccurrencycurrencynamecurrencysymbolcurrencycodeamount
Unique Identifiers:
pinssnimei(Phone IMEI)mac(MAC Address)vehiclevin(Vehicle VIN)vehiclevrm(Vehicle VRM)
Cryptocurrency Information:
bitcoinaddresslitecoinaddressethereumaddress
Other Information:
ip(IP Address)ipv4ipv6maskednumberpasswordtimeordinaldirectionprefix
Prompt Format
### Instruction:
Identify and extract the following PII entities from the text, if present: companyname, pin, currencyname, email, phoneimei, litecoinaddress, currency, eyecolor, street, mac, state, time, vehiclevin, jobarea, date, bic, currencysymbol, currencycode, age, nearbygpscoordinate, amount, ssn, ethereumaddress, zipcode, buildingnumber, dob, firstname, middlename, ordinaldirection, jobtitle, bitcoinaddress, jobtype, phonenumber, height, password, ip, useragent, accountname, city, gender, secondaryaddress, iban, sex, prefix, ipv4, maskednumber, url, username, lastname, creditcardcvv, county, vehiclevrm, ipv6, creditcardissuer, accountnumber, creditcardnumber. Return the output in JSON format.
### Input:
Greetings, Mason! Let's celebrate another year of wellness on 14/01/1977. Don't miss the event at 176,Apt. 388.
### Output:
Usage
Installation
To use this model, you'll need to have the transformers library installed:
pip install transformers
Run Inference
from transformers import AutoTokenizer, AutoModelForTokenClassification
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("ab-ai/PII-Model-Phi3-Mini")
model = AutoModelForTokenClassification.from_pretrained("ab-ai/PII-Model-Phi3-Mini")
input_text = "Hi Abner, just a reminder that your next primary care appointment is on 23/03/1926. Please confirm by replying to this email Nathen15@hotmail.com."
model_prompt = f"""### Instruction:
Identify and extract the following PII entities from the text, if present: companyname, pin, currencyname, email, phoneimei, litecoinaddress, currency, eyecolor, street, mac, state, time, vehiclevin, jobarea, date, bic, currencysymbol, currencycode, age, nearbygpscoordinate, amount, ssn, ethereumaddress, zipcode, buildingnumber, dob, firstname, middlename, ordinaldirection, jobtitle, bitcoinaddress, jobtype, phonenumber, height, password, ip, useragent, accountname, city, gender, secondaryaddress, iban, sex, prefix, ipv4, maskednumber, url, username, lastname, creditcardcvv, county, vehiclevrm, ipv6, creditcardissuer, accountnumber, creditcardnumber. Return the output in JSON format.
### Input:
{input_text}
### Output: """
inputs = tokenizer(model_prompt, return_tensors="pt").to(device)
# adjust max_new_tokens according to your need
outputs = model.generate(**inputs, do_sample=True, max_new_tokens=120)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response) #{'middlename': ['Abner'], 'dob': ['23/03/1926'], 'email': ['Nathen15@hotmail.com']}
- Downloads last month
- 13
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit