Instructions to use q-future/Compare2Score with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use q-future/Compare2Score with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="q-future/Compare2Score", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("q-future/Compare2Score", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update modeling_mplug_owl2.py
Browse files- modeling_mplug_owl2.py +2 -2
modeling_mplug_owl2.py
CHANGED
|
@@ -308,8 +308,8 @@ class MPLUGOwl2LlamaForCausalLM(LlamaForCausalLM, MPLUGOwl2MetaForCausalLM):
|
|
| 308 |
def __init__(self, config):
|
| 309 |
super(LlamaForCausalLM, self).__init__(config)
|
| 310 |
self.model = MPLUGOwl2LlamaModel(config)
|
| 311 |
-
self.tokenizer = AutoTokenizer.from_pretrained("
|
| 312 |
-
self.image_processor = CLIPImageProcessor.from_pretrained("
|
| 313 |
|
| 314 |
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
|
| 315 |
self.preferential_ids_ = [id_[1] for id_ in self.tokenizer(["inferior", "worse", "similar", "better", "superior"])["input_ids"]]
|
|
|
|
| 308 |
def __init__(self, config):
|
| 309 |
super(LlamaForCausalLM, self).__init__(config)
|
| 310 |
self.model = MPLUGOwl2LlamaModel(config)
|
| 311 |
+
self.tokenizer = AutoTokenizer.from_pretrained("q-future/Compare2Score")
|
| 312 |
+
self.image_processor = CLIPImageProcessor.from_pretrained("q-future/Compare2Score")
|
| 313 |
|
| 314 |
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
|
| 315 |
self.preferential_ids_ = [id_[1] for id_ in self.tokenizer(["inferior", "worse", "similar", "better", "superior"])["input_ids"]]
|