Instructions to use ohgnues/FiDT5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ohgnues/FiDT5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="ohgnues/FiDT5", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("ohgnues/FiDT5", trust_remote_code=True) model = AutoModel.from_pretrained("ohgnues/FiDT5", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update modeling_fid.py
Browse files- modeling_fid.py +0 -2
modeling_fid.py
CHANGED
|
@@ -1031,7 +1031,6 @@ class FiDStack(FiDPreTrainedModel):
|
|
| 1031 |
if self.embed_tokens is None:
|
| 1032 |
raise ValueError("You have to initialize the model with valid token embeddings")
|
| 1033 |
inputs_embeds = self.embed_tokens(input_ids)
|
| 1034 |
-
print("decoder", input_shape)
|
| 1035 |
batch_size, seq_length = input_shape
|
| 1036 |
|
| 1037 |
# required mask seq length can be calculated via length of past
|
|
@@ -1319,7 +1318,6 @@ class FiDWrapper(FiDPreTrainedModel):
|
|
| 1319 |
if self.embed_tokens is None:
|
| 1320 |
raise ValueError("You have to initialize the model with valid token embeddings")
|
| 1321 |
inputs_embeds = self.embed_tokens(input_ids)
|
| 1322 |
-
print("encoder", input_shape)
|
| 1323 |
batch_size, seq_length = input_shape
|
| 1324 |
|
| 1325 |
# required mask seq length can be calculated via length of past
|
|
|
|
| 1031 |
if self.embed_tokens is None:
|
| 1032 |
raise ValueError("You have to initialize the model with valid token embeddings")
|
| 1033 |
inputs_embeds = self.embed_tokens(input_ids)
|
|
|
|
| 1034 |
batch_size, seq_length = input_shape
|
| 1035 |
|
| 1036 |
# required mask seq length can be calculated via length of past
|
|
|
|
| 1318 |
if self.embed_tokens is None:
|
| 1319 |
raise ValueError("You have to initialize the model with valid token embeddings")
|
| 1320 |
inputs_embeds = self.embed_tokens(input_ids)
|
|
|
|
| 1321 |
batch_size, seq_length = input_shape
|
| 1322 |
|
| 1323 |
# required mask seq length can be calculated via length of past
|