Image-Text-to-Text
Transformers
Safetensors
multilingual
GOT
feature-extraction
got
vision-language
ocr2.0
custom_code
Instructions to use srimanth-d/GOT_CPU with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use srimanth-d/GOT_CPU with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="srimanth-d/GOT_CPU", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("srimanth-d/GOT_CPU", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use srimanth-d/GOT_CPU with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "srimanth-d/GOT_CPU" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "srimanth-d/GOT_CPU", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/srimanth-d/GOT_CPU
- SGLang
How to use srimanth-d/GOT_CPU 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 "srimanth-d/GOT_CPU" \ --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": "srimanth-d/GOT_CPU", "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 "srimanth-d/GOT_CPU" \ --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": "srimanth-d/GOT_CPU", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use srimanth-d/GOT_CPU with Docker Model Runner:
docker model run hf.co/srimanth-d/GOT_CPU
Update README.md
Browse files
README.md
CHANGED
|
@@ -26,7 +26,7 @@ license: apache-2.0
|
|
| 26 |
|
| 27 |
|
| 28 |
## Usage
|
| 29 |
-
Inference using Huggingface transformers on
|
| 30 |
```
|
| 31 |
torch==2.0.1
|
| 32 |
torchvision==0.15.2
|
|
@@ -40,9 +40,9 @@ accelerate==0.28.0
|
|
| 40 |
```python
|
| 41 |
from transformers import AutoModel, AutoTokenizer
|
| 42 |
|
| 43 |
-
tokenizer = AutoTokenizer.from_pretrained('
|
| 44 |
-
model = AutoModel.from_pretrained('
|
| 45 |
-
model = model.eval()
|
| 46 |
|
| 47 |
|
| 48 |
# input your test image
|
|
|
|
| 26 |
|
| 27 |
|
| 28 |
## Usage
|
| 29 |
+
Inference using Huggingface transformers on CPU. Requirements tested on python 3.10:
|
| 30 |
```
|
| 31 |
torch==2.0.1
|
| 32 |
torchvision==0.15.2
|
|
|
|
| 40 |
```python
|
| 41 |
from transformers import AutoModel, AutoTokenizer
|
| 42 |
|
| 43 |
+
tokenizer = AutoTokenizer.from_pretrained('srimanth-d/GOT_CPU', trust_remote_code=True)
|
| 44 |
+
model = AutoModel.from_pretrained('srimanth-d/GOT_CPU', trust_remote_code=True, low_cpu_mem_usage=True, use_safetensors=True, pad_token_id=tokenizer.eos_token_id)
|
| 45 |
+
model = model.eval()
|
| 46 |
|
| 47 |
|
| 48 |
# input your test image
|