Instructions to use zjunlp/HalDet-llava-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zjunlp/HalDet-llava-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="zjunlp/HalDet-llava-7b")# Load model directly from transformers import AutoProcessor, AutoModelForCausalLM processor = AutoProcessor.from_pretrained("zjunlp/HalDet-llava-7b") model = AutoModelForCausalLM.from_pretrained("zjunlp/HalDet-llava-7b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use zjunlp/HalDet-llava-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zjunlp/HalDet-llava-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zjunlp/HalDet-llava-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/zjunlp/HalDet-llava-7b
- SGLang
How to use zjunlp/HalDet-llava-7b 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 "zjunlp/HalDet-llava-7b" \ --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": "zjunlp/HalDet-llava-7b", "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 "zjunlp/HalDet-llava-7b" \ --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": "zjunlp/HalDet-llava-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use zjunlp/HalDet-llava-7b with Docker Model Runner:
docker model run hf.co/zjunlp/HalDet-llava-7b
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,4 +1,14 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
---
|
| 4 |
-
HalDet-LLaVA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
---
|
| 4 |
+
## HalDet-LLaVA
|
| 5 |
+
|
| 6 |
+
HalDet-LLaVA is designed for multimodal hallucination detection, trained on the MHaluBench training dataset, achieving detection performance close to that of using GPT4-Vision.
|
| 7 |
+
|
| 8 |
+
HalDet-LLaVA is trained on the [MHaluBench training set](https://huggingface.co/datasets/openkg/MHaluBench/blob/main/MHaluBench_train.json) using LLaVA-v1.5, specific parameters can be found in the file [finetune_task_lora.sh](https://github.com/zjunlp/EasyDetect/blob/main/HalDet-LLaVA/finetune_task_lora.sh).
|
| 9 |
+
|
| 10 |
+
We trained HalDet-LLaVA on 1-A800 in 1 hour. If you don"t have enough GPU resources, we will soon provide model distributed training scripts.
|
| 11 |
+
|
| 12 |
+
You can inference our HalDet-LLaVA by using [inference.py](https://github.com/zjunlp/EasyDetect/blob/main/HalDet-LLaVA/inference.py)
|
| 13 |
+
|
| 14 |
+
To view more detailed information about HalDet-LLaVA and the train dataset, please refer to the [EasyDetect](https://github.com/zjunlp/EasyDetect) and [readme](https://github.com/zjunlp/EasyDetect/blob/main/HalDet-LLaVA/README.md)
|