Instructions to use anthrapper/tcrocr-captcha with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use anthrapper/tcrocr-captcha with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="anthrapper/tcrocr-captcha")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("anthrapper/tcrocr-captcha") model = AutoModelForMultimodalLM.from_pretrained("anthrapper/tcrocr-captcha", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use anthrapper/tcrocr-captcha with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "anthrapper/tcrocr-captcha" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anthrapper/tcrocr-captcha", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/anthrapper/tcrocr-captcha
- SGLang
How to use anthrapper/tcrocr-captcha 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 "anthrapper/tcrocr-captcha" \ --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": "anthrapper/tcrocr-captcha", "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 "anthrapper/tcrocr-captcha" \ --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": "anthrapper/tcrocr-captcha", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use anthrapper/tcrocr-captcha with Docker Model Runner:
docker model run hf.co/anthrapper/tcrocr-captcha
Commit ·
900c1f8
1
Parent(s): decde3c
Upload folder using huggingface_hub
Browse files
captcha_model/config.json
CHANGED
|
@@ -165,13 +165,14 @@
|
|
| 165 |
"eos_token_id": 2,
|
| 166 |
"is_encoder_decoder": true,
|
| 167 |
"length_penalty": 2.0,
|
| 168 |
-
"max_length":
|
|
|
|
| 169 |
"model_type": "vision-encoder-decoder",
|
| 170 |
"no_repeat_ngram_size": 3,
|
| 171 |
"num_beams": 4,
|
| 172 |
"pad_token_id": 1,
|
| 173 |
"tie_word_embeddings": false,
|
| 174 |
"torch_dtype": "float32",
|
| 175 |
-
"transformers_version": "4.33.
|
| 176 |
"vocab_size": 50265
|
| 177 |
}
|
|
|
|
| 165 |
"eos_token_id": 2,
|
| 166 |
"is_encoder_decoder": true,
|
| 167 |
"length_penalty": 2.0,
|
| 168 |
+
"max_length": 5,
|
| 169 |
+
"min_length": 5,
|
| 170 |
"model_type": "vision-encoder-decoder",
|
| 171 |
"no_repeat_ngram_size": 3,
|
| 172 |
"num_beams": 4,
|
| 173 |
"pad_token_id": 1,
|
| 174 |
"tie_word_embeddings": false,
|
| 175 |
"torch_dtype": "float32",
|
| 176 |
+
"transformers_version": "4.33.0",
|
| 177 |
"vocab_size": 50265
|
| 178 |
}
|
captcha_model/generation_config.json
CHANGED
|
@@ -4,10 +4,11 @@
|
|
| 4 |
"early_stopping": true,
|
| 5 |
"eos_token_id": 2,
|
| 6 |
"length_penalty": 2.0,
|
| 7 |
-
"max_length":
|
|
|
|
| 8 |
"no_repeat_ngram_size": 3,
|
| 9 |
"num_beams": 4,
|
| 10 |
"pad_token_id": 1,
|
| 11 |
-
"transformers_version": "4.33.
|
| 12 |
"use_cache": false
|
| 13 |
}
|
|
|
|
| 4 |
"early_stopping": true,
|
| 5 |
"eos_token_id": 2,
|
| 6 |
"length_penalty": 2.0,
|
| 7 |
+
"max_length": 5,
|
| 8 |
+
"min_length": 5,
|
| 9 |
"no_repeat_ngram_size": 3,
|
| 10 |
"num_beams": 4,
|
| 11 |
"pad_token_id": 1,
|
| 12 |
+
"transformers_version": "4.33.0",
|
| 13 |
"use_cache": false
|
| 14 |
}
|
captcha_model/pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1539625673
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:586e88f77ccd1f41ead35d4e1fbce459f490a86a87a7036bbda167a482f5f597
|
| 3 |
size 1539625673
|
captcha_model/training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4155
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:38d59a5e5767fed3b122e8f0244a89603640bc3155e0b06246ee8e29ce3c5fbb
|
| 3 |
size 4155
|