Instructions to use SebastianSchramm/UniNER-7B-definition-GPTQ-4bit-128g-actorder_True with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SebastianSchramm/UniNER-7B-definition-GPTQ-4bit-128g-actorder_True with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SebastianSchramm/UniNER-7B-definition-GPTQ-4bit-128g-actorder_True")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SebastianSchramm/UniNER-7B-definition-GPTQ-4bit-128g-actorder_True") model = AutoModelForCausalLM.from_pretrained("SebastianSchramm/UniNER-7B-definition-GPTQ-4bit-128g-actorder_True") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SebastianSchramm/UniNER-7B-definition-GPTQ-4bit-128g-actorder_True with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SebastianSchramm/UniNER-7B-definition-GPTQ-4bit-128g-actorder_True" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SebastianSchramm/UniNER-7B-definition-GPTQ-4bit-128g-actorder_True", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SebastianSchramm/UniNER-7B-definition-GPTQ-4bit-128g-actorder_True
- SGLang
How to use SebastianSchramm/UniNER-7B-definition-GPTQ-4bit-128g-actorder_True with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "SebastianSchramm/UniNER-7B-definition-GPTQ-4bit-128g-actorder_True" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SebastianSchramm/UniNER-7B-definition-GPTQ-4bit-128g-actorder_True", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "SebastianSchramm/UniNER-7B-definition-GPTQ-4bit-128g-actorder_True" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SebastianSchramm/UniNER-7B-definition-GPTQ-4bit-128g-actorder_True", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SebastianSchramm/UniNER-7B-definition-GPTQ-4bit-128g-actorder_True with Docker Model Runner:
docker model run hf.co/SebastianSchramm/UniNER-7B-definition-GPTQ-4bit-128g-actorder_True
Quantized version of Universal-NER/UniNER-7B-definition
Universal-NER/UniNER-7B-definition quantized to 4bit with GPTQ and stored with 1GB shard size.
Model Description
The model Universal-NER/UniNER-7B-definition was quantized to 4bit, group_size 128, and act-order=True with auto-gptq integration in transformers (https://huggingface.co/blog/gptq-integration).
Evaluation
TODO
Prompt template
Prompt template is the same as for the full precision model:
prompt_template = """A virtual assistant answers questions from a user based on the provided text.
USER: Text: {input_text}
ASSISTANT: I’ve read this text.
USER: What describes {entity_name} in the text?
ASSISTANT:
"""
Usage
It is recommended to format input according to the prompt template mentioned above during inference for best results.
prompt = prompt_template.format_map({"input_text": "Cologne is a great city in Germany - maybe even the greatest ;)", "entity_name": "city"})
The model is small enough to be loaded in free-tier Colab with a T4 GPU: https://gist.github.com/sebastianschramm/b849c06676c6601d9a87270e83f5a157
License
The original full precision model and its associated data are released under the CC BY-NC 4.0 license. Hence, the same license applies for the 4bit version.
- Downloads last month
- 3
