Instructions to use QuantFactory/NuExtract-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use QuantFactory/NuExtract-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/NuExtract-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/NuExtract-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/NuExtract-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/NuExtract-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf QuantFactory/NuExtract-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf QuantFactory/NuExtract-GGUF:Q4_K_M
Use Docker
docker model run hf.co/QuantFactory/NuExtract-GGUF:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use QuantFactory/NuExtract-GGUF with Ollama:
ollama run hf.co/QuantFactory/NuExtract-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use QuantFactory/NuExtract-GGUF with Docker Model Runner:
docker model run hf.co/QuantFactory/NuExtract-GGUF:Q4_K_M
- Lemonade
How to use QuantFactory/NuExtract-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull QuantFactory/NuExtract-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.NuExtract-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Upload README.md with huggingface_hub
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
---
license: mitlanguage:- enbase_model: microsoft/Phi-3-mini-4k-instruct
---
[](https://hf.co/QuantFactory)
# QuantFactory/NuExtract-GGUFThis is quantized version of [numind/NuExtract](https://huggingface.co/numind/NuExtract) created using llama.cpp
# Original Model Card
> ⚠️ **_NOTE:_** This model is out-dated. Find the updated version [here](https://huggingface.co/numind/NuExtract-v1.5)
# Structure Extraction Model by NuMind 🔥
NuExtract is a version of [phi-3-mini](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct), fine-tuned on a private high-quality synthetic dataset for information extraction. To use the model, provide an input text (less than 2000 tokens) and a JSON template describing the information you need to extract.
Note: This model is purely extractive, so all text output by the model is present as is in the original text. You can also provide an example of output formatting to help the model understand your task more precisely.
Try it here: https://huggingface.co/spaces/numind/NuExtract
We also provide a tiny(0.5B) and large(7B) version of this model: [NuExtract-tiny](https://huggingface.co/numind/NuExtract-tiny) and [NuExtract-large](https://huggingface.co/numind/NuExtract-large)
**Checkout other models by NuMind:*** SOTA Zero-shot NER Model [NuNER Zero](https://huggingface.co/numind/NuNER_Zero)* SOTA Multilingual Entity Recognition Foundation Model: [link](https://huggingface.co/numind/entity-recognition-multilingual-general-sota-v1)* SOTA Sentiment Analysis Foundation Model: [English](https://huggingface.co/numind/generic-sentiment-v1), [Multilingual](https://huggingface.co/numind/generic-sentiment-multi-v1)
## Benchmark
Benchmark 0 shot (will release soon):
<p align="left"><img src="result.png" width="600"></p>
Benchmark fine-tunning (see blog post):
<p align="left"><img src="result_ft.png" width="600"></p>
## Usage
To use the model:
```pythonimport jsonfrom transformers import AutoModelForCausalLM, AutoTokenizer
def predict_NuExtract(model, tokenizer, text, schema, example=["", "", ""]): schema = json.dumps(json.loads(schema), indent=4) input_llm = "<|input|>\n### Template:\n" + schema + "\n" for i in example: if i != "": input_llm += "### Example:\n"+ json.dumps(json.loads(i), indent=4)+"\n" input_llm += "### Text:\n"+text +"\n<|output|>\n" input_ids = tokenizer(input_llm, return_tensors="pt",truncation = True, max_length=4000).to("cuda")
output = tokenizer.decode(model.generate(**input_ids)[0], skip_special_tokens=True) return output.split("<|output|>")[1].split("<|end-output|>")[0]
# We recommend using bf16 as it results in negligable performance lossmodel = AutoModelForCausalLM.from_pretrained("numind/NuExtract", torch_dtype=torch.bfloat16, trust_remote_code=True)tokenizer = AutoTokenizer.from_pretrained("numind/NuExtract", trust_remote_code=True)
model.to("cuda")
model.eval()
text = """We introduce Mistral 7B, a 7–billion-parameter language model engineered forsuperior performance and efficiency. Mistral 7B outperforms the best open 13Bmodel (Llama 2) across all evaluated benchmarks, and the best released 34Bmodel (Llama 1) in reasoning, mathematics, and code generation. Our modelleverages grouped-query attention (GQA) for faster inference, coupled with slidingwindow attention (SWA) to effectively handle sequences of arbitrary length with areduced inference cost. We also provide a model fine-tuned to follow instructions,Mistral 7B – Instruct, that surpasses Llama 2 13B – chat model both on human andautomated benchmarks. Our models are released under the Apache 2.0 license.Code: https://github.com/mistralai/mistral-srcWebpage: https://mistral.ai/news/announcing-mistral-7b/"""
schema = """{ "Model": { "Name": "", "Number of parameters": "", "Number of max token": "", "Architecture": [] }, "Usage": { "Use case": [], "Licence": "" }}"""
prediction = predict_NuExtract(model, tokenizer, text, schema, example=["","",""])print(prediction)
```README.mdAdded+112