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", device_map="auto") - 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
|
@@ -1,10 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# UniNER-7B-all
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
Check our [paper](https://arxiv.org/abs/2308.03279) for more information.
|
| 6 |
|
| 7 |
-
##
|
|
|
|
|
|
|
|
|
|
| 8 |
```python
|
| 9 |
# Install transformers from source - only needed for versions <= v4.34
|
| 10 |
# pip install git+https://github.com/huggingface/transformers.git
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- Universal-NER/Pile-NER-type
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
---
|
| 8 |
+
<div align="center">
|
| 9 |
+
|
| 10 |
# UniNER-7B-all
|
| 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 our [paper](https://arxiv.org/abs/2308.03279) for more information.
|
| 18 |
|
| 19 |
+
### How to use
|
| 20 |
+
You will need the transformers>=4.34
|
| 21 |
+
Do check the [TinyLlama](https://github.com/jzhang38/TinyLlama) github page for more information.
|
| 22 |
+
|
| 23 |
```python
|
| 24 |
# Install transformers from source - only needed for versions <= v4.34
|
| 25 |
# pip install git+https://github.com/huggingface/transformers.git
|