Instructions to use qihoo360/360Zhinao-1.8B-Reranking with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use qihoo360/360Zhinao-1.8B-Reranking with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="qihoo360/360Zhinao-1.8B-Reranking", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("qihoo360/360Zhinao-1.8B-Reranking", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use qihoo360/360Zhinao-1.8B-Reranking with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "qihoo360/360Zhinao-1.8B-Reranking" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "qihoo360/360Zhinao-1.8B-Reranking", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/qihoo360/360Zhinao-1.8B-Reranking
- SGLang
How to use qihoo360/360Zhinao-1.8B-Reranking 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 "qihoo360/360Zhinao-1.8B-Reranking" \ --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": "qihoo360/360Zhinao-1.8B-Reranking", "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 "qihoo360/360Zhinao-1.8B-Reranking" \ --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": "qihoo360/360Zhinao-1.8B-Reranking", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use qihoo360/360Zhinao-1.8B-Reranking with Docker Model Runner:
docker model run hf.co/qihoo360/360Zhinao-1.8B-Reranking
Update model metadata to set pipeline tag to the new `text-ranking` and tags to `sentence-transformers`
Hello!
Pull Request overview
- Update metadata to set pipeline tag to the new
text-ranking - Update metadata to set tags to
sentence-transformers
Changes
This is an automated pull request to update the metadata of the model card. We recently introduced the text-ranking pipeline tag for models that are used for ranking tasks, and we have a suspicion that this model is one of them. I also updated added metadata to specify that this model can be loaded with the sentence-transformers library, as it should be possible to load any model compatible with transformers AutoModelForSequenceClassification.
Feel free to verify that it works with the following:
pip install sentence-transformers
from sentence_transformers import CrossEncoder
model = CrossEncoder("qihoo360/360Zhinao-1.8B-Reranking")
scores = model.predict([
("How many people live in Berlin?", "Berlin had a population of 3,520,031 registered inhabitants in an area of 891.82 square kilometers."),
("How many people live in Berlin?", "Berlin is well known for its museums."),
])
print(scores)
Feel free to respond if you have questions or concerns.
- Tom Aarsen