Text Generation
Transformers
Safetensors
PyTorch
English
t5
text2text-generation
text-generation-inference
Instructions to use younsmirzai/stackadvisor-extractor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use younsmirzai/stackadvisor-extractor with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="younsmirzai/stackadvisor-extractor")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("younsmirzai/stackadvisor-extractor") model = AutoModelForSeq2SeqLM.from_pretrained("younsmirzai/stackadvisor-extractor", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use younsmirzai/stackadvisor-extractor with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "younsmirzai/stackadvisor-extractor" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "younsmirzai/stackadvisor-extractor", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/younsmirzai/stackadvisor-extractor
- SGLang
How to use younsmirzai/stackadvisor-extractor 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 "younsmirzai/stackadvisor-extractor" \ --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": "younsmirzai/stackadvisor-extractor", "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 "younsmirzai/stackadvisor-extractor" \ --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": "younsmirzai/stackadvisor-extractor", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use younsmirzai/stackadvisor-extractor with Docker Model Runner:
docker model run hf.co/younsmirzai/stackadvisor-extractor
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,25 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
| 3 |
tags:
|
| 4 |
- t5
|
| 5 |
- pytorch
|
| 6 |
-
- text2text-generation
|
| 7 |
---
|
| 8 |
|
| 9 |
# StackAdvisor Order Extractor
|
| 10 |
|
| 11 |
-
T5-small model
|
| 12 |
-
|
| 13 |
-
## Usage
|
| 14 |
-
```python
|
| 15 |
-
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
| 16 |
-
|
| 17 |
-
model = T5ForConditionalGeneration.from_pretrained("younsmirzai/stackadvisor-extractor")
|
| 18 |
-
tokenizer = T5Tokenizer.from_pretrained("younsmirzai/stackadvisor-extractor")
|
| 19 |
-
|
| 20 |
-
text = "£6.04 2 orders Sainsbury's SA18JA Accept and go"
|
| 21 |
-
inputs = tokenizer(text, return_tensors="pt", max_length=256, truncation=True)
|
| 22 |
-
outputs = model.generate(**inputs, max_length=128)
|
| 23 |
-
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 24 |
-
print(result)
|
| 25 |
-
```
|
|
|
|
| 1 |
---
|
| 2 |
+
language: en
|
| 3 |
+
license: mit
|
| 4 |
+
library_name: transformers
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
tags:
|
| 7 |
- t5
|
| 8 |
- pytorch
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
# StackAdvisor Order Extractor
|
| 12 |
|
| 13 |
+
T5-small model for extracting delivery order information from OCR text.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|