Instructions to use GitBag/Reviewer2_Mp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GitBag/Reviewer2_Mp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GitBag/Reviewer2_Mp") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("GitBag/Reviewer2_Mp") model = AutoModelForCausalLM.from_pretrained("GitBag/Reviewer2_Mp", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use GitBag/Reviewer2_Mp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GitBag/Reviewer2_Mp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GitBag/Reviewer2_Mp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/GitBag/Reviewer2_Mp
- SGLang
How to use GitBag/Reviewer2_Mp 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 "GitBag/Reviewer2_Mp" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GitBag/Reviewer2_Mp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "GitBag/Reviewer2_Mp" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GitBag/Reviewer2_Mp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use GitBag/Reviewer2_Mp with Docker Model Runner:
docker model run hf.co/GitBag/Reviewer2_Mp
Create README.md
Browse files
README.md
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- GitBag/Reviewer2_PGE_cleaned
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
metrics:
|
| 8 |
+
- bleu
|
| 9 |
+
- rouge
|
| 10 |
+
- bertscore
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# Prompt Generation Model for [Reviewer2](https://arxiv.org/abs/2402.10886)
|
| 14 |
+
|
| 15 |
+
This is the prompt generation model (Mp) for our Reviewer2 pipeline. A demo of the model is provided in this [repo](https://github.com/ZhaolinGao/Reviewer2/tree/main).
|
| 16 |
+
|
| 17 |
+
## Citation
|
| 18 |
+
|
| 19 |
+
If you find this model useful in your research, please cite the following paper:
|
| 20 |
+
|
| 21 |
+
```
|
| 22 |
+
@misc{gao2024reviewer2,
|
| 23 |
+
title={Reviewer2: Optimizing Review Generation Through Prompt Generation},
|
| 24 |
+
author={Zhaolin Gao and Kianté Brantley and Thorsten Joachims},
|
| 25 |
+
year={2024},
|
| 26 |
+
eprint={2402.10886},
|
| 27 |
+
archivePrefix={arXiv},
|
| 28 |
+
primaryClass={cs.CL}
|
| 29 |
+
}
|
| 30 |
+
```
|