Instructions to use LR-AI-Labs/tiny-universal-NER with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LR-AI-Labs/tiny-universal-NER with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LR-AI-Labs/tiny-universal-NER")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LR-AI-Labs/tiny-universal-NER") model = AutoModelForCausalLM.from_pretrained("LR-AI-Labs/tiny-universal-NER") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LR-AI-Labs/tiny-universal-NER with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LR-AI-Labs/tiny-universal-NER" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LR-AI-Labs/tiny-universal-NER", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LR-AI-Labs/tiny-universal-NER
- SGLang
How to use LR-AI-Labs/tiny-universal-NER 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 "LR-AI-Labs/tiny-universal-NER" \ --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": "LR-AI-Labs/tiny-universal-NER", "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 "LR-AI-Labs/tiny-universal-NER" \ --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": "LR-AI-Labs/tiny-universal-NER", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use LR-AI-Labs/tiny-universal-NER with Docker Model Runner:
docker model run hf.co/LR-AI-Labs/tiny-universal-NER
Update README.md
Browse files
README.md
CHANGED
|
@@ -7,14 +7,14 @@ language:
|
|
| 7 |
---
|
| 8 |
<div align="center">
|
| 9 |
|
| 10 |
-
#
|
| 11 |
</div>
|
| 12 |
|
| 13 |
This model is finetuned from [TinyLLama](https://huggingface.co/TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T).
|
| 14 |
|
| 15 |
It is trained on ChatGPT-generated [Pile-NER-type data](https://huggingface.co/datasets/Universal-NER/Pile-NER-type).
|
| 16 |
|
| 17 |
-
Check
|
| 18 |
|
| 19 |
|
| 20 |
### How to use
|
|
@@ -28,7 +28,7 @@ Do check the [TinyLlama](https://github.com/jzhang38/TinyLlama) github page for
|
|
| 28 |
import torch
|
| 29 |
from transformers import pipeline
|
| 30 |
|
| 31 |
-
pipe = pipeline("text-generation", model="
|
| 32 |
torch_dtype=torch.bfloat16, device_map="auto")
|
| 33 |
messages = [
|
| 34 |
{
|
|
|
|
| 7 |
---
|
| 8 |
<div align="center">
|
| 9 |
|
| 10 |
+
# tiny-universal-NER
|
| 11 |
</div>
|
| 12 |
|
| 13 |
This model is finetuned from [TinyLLama](https://huggingface.co/TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T).
|
| 14 |
|
| 15 |
It is trained on ChatGPT-generated [Pile-NER-type data](https://huggingface.co/datasets/Universal-NER/Pile-NER-type).
|
| 16 |
|
| 17 |
+
Check this [paper](https://arxiv.org/abs/2308.03279) for more information.
|
| 18 |
|
| 19 |
|
| 20 |
### How to use
|
|
|
|
| 28 |
import torch
|
| 29 |
from transformers import pipeline
|
| 30 |
|
| 31 |
+
pipe = pipeline("text-generation", model="LR-AI-Labs/tiny-universal-NER",
|
| 32 |
torch_dtype=torch.bfloat16, device_map="auto")
|
| 33 |
messages = [
|
| 34 |
{
|