Image-Text-to-Text
Transformers
Safetensors
PyTorch
English
clip-mtl
feature-extraction
mmhs150k
multimodal
hate-speech-detection
content-moderation
clip
multi-task-learning
custom_code
Eval Results (legacy)
Instructions to use Amirhossein75/clip-vit-base-mmhs150k-mtl with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Amirhossein75/clip-vit-base-mmhs150k-mtl with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Amirhossein75/clip-vit-base-mmhs150k-mtl", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Amirhossein75/clip-vit-base-mmhs150k-mtl", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Amirhossein75/clip-vit-base-mmhs150k-mtl with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Amirhossein75/clip-vit-base-mmhs150k-mtl" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Amirhossein75/clip-vit-base-mmhs150k-mtl", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Amirhossein75/clip-vit-base-mmhs150k-mtl
- SGLang
How to use Amirhossein75/clip-vit-base-mmhs150k-mtl 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 "Amirhossein75/clip-vit-base-mmhs150k-mtl" \ --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": "Amirhossein75/clip-vit-base-mmhs150k-mtl", "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 "Amirhossein75/clip-vit-base-mmhs150k-mtl" \ --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": "Amirhossein75/clip-vit-base-mmhs150k-mtl", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Amirhossein75/clip-vit-base-mmhs150k-mtl with Docker Model Runner:
docker model run hf.co/Amirhossein75/clip-vit-base-mmhs150k-mtl
Upload inference_config.json with huggingface_hub
Browse files- inference_config.json +22 -0
inference_config.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"encoder_name": "openai/clip-vit-base-patch32",
|
| 3 |
+
"backend": "clip",
|
| 4 |
+
"head": "mtl",
|
| 5 |
+
"fusion_dim": 512,
|
| 6 |
+
"threshold": 0.5,
|
| 7 |
+
"thresholds": [
|
| 8 |
+
0.3,
|
| 9 |
+
0.7,
|
| 10 |
+
0.49999999999999994,
|
| 11 |
+
0.3,
|
| 12 |
+
0.5499999999999999
|
| 13 |
+
],
|
| 14 |
+
"class_names": [
|
| 15 |
+
"racist",
|
| 16 |
+
"sexist",
|
| 17 |
+
"homophobe",
|
| 18 |
+
"religion",
|
| 19 |
+
"otherhate"
|
| 20 |
+
],
|
| 21 |
+
"best_checkpoint_dir": "runs/clip_mtl_mmhshateful\\checkpoint-11236"
|
| 22 |
+
}
|