Instructions to use openbmb/Eurus-RM-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/Eurus-RM-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="openbmb/Eurus-RM-7b", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("openbmb/Eurus-RM-7b", trust_remote_code=True) model = AutoModel.from_pretrained("openbmb/Eurus-RM-7b", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
Enable flash_attention_2 support since the underlying Mistral model supports it
#3
by winglian - opened
- modeling_eurus_rm.py +2 -0
modeling_eurus_rm.py
CHANGED
|
@@ -5,6 +5,8 @@ from typing import Optional, List
|
|
| 5 |
|
| 6 |
class EurusRewardModel(PreTrainedModel):
|
| 7 |
config_class = MistralConfig
|
|
|
|
|
|
|
| 8 |
def __init__(self, config):
|
| 9 |
super().__init__(config)
|
| 10 |
self.model = MistralModel(config)
|
|
|
|
| 5 |
|
| 6 |
class EurusRewardModel(PreTrainedModel):
|
| 7 |
config_class = MistralConfig
|
| 8 |
+
_supports_flash_attn_2 = True
|
| 9 |
+
|
| 10 |
def __init__(self, config):
|
| 11 |
super().__init__(config)
|
| 12 |
self.model = MistralModel(config)
|