Unverified Commit 27b3031d authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Mass conversion of documentation from rst to Markdown (#14866)

* Convert docstrings of all configurations and tokenizers

* Processors and fixes

* Last modeling files and fixes to models

* Pipeline modules

* Utils files

* Data submodule

* All the other files

* Style

* Missing examples

* Style again

* Fix copies

* Say bye bye to rst docstrings forever
parent 18587639
This diff is collapsed.
...@@ -69,7 +69,7 @@ def rename_key_and_reshape_tensor( ...@@ -69,7 +69,7 @@ def rename_key_and_reshape_tensor(
"""Rename PT weight names to corresponding Flax weight names and reshape tensor if necessary""" """Rename PT weight names to corresponding Flax weight names and reshape tensor if necessary"""
def is_key_or_prefix_key_in_dict(key: Tuple[str]) -> bool: def is_key_or_prefix_key_in_dict(key: Tuple[str]) -> bool:
"""Checks if ``key`` of ``(prefix,) + key`` is in random_flax_state_dict""" """Checks if `key` of `(prefix,) + key` is in random_flax_state_dict"""
return len(set(random_flax_state_dict) & set([key, (model_prefix,) + key])) > 0 return len(set(random_flax_state_dict) & set([key, (model_prefix,) + key])) > 0
# layer norm # layer norm
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -742,18 +742,20 @@ class FlaxAlbertForPreTraining(FlaxAlbertPreTrainedModel): ...@@ -742,18 +742,20 @@ class FlaxAlbertForPreTraining(FlaxAlbertPreTrainedModel):
FLAX_ALBERT_FOR_PRETRAINING_DOCSTRING = """ FLAX_ALBERT_FOR_PRETRAINING_DOCSTRING = """
Returns: Returns:
Example:: Example:
>>> from transformers import AlbertTokenizer, FlaxAlbertForPreTraining ```python
>>> from transformers import AlbertTokenizer, FlaxAlbertForPreTraining
>>> tokenizer = AlbertTokenizer.from_pretrained('albert-base-v2') >>> tokenizer = AlbertTokenizer.from_pretrained('albert-base-v2')
>>> model = FlaxAlbertForPreTraining.from_pretrained('albert-base-v2') >>> model = FlaxAlbertForPreTraining.from_pretrained('albert-base-v2')
>>> inputs = tokenizer("Hello, my dog is cute", return_tensors="np") >>> inputs = tokenizer("Hello, my dog is cute", return_tensors="np")
>>> outputs = model(**inputs) >>> outputs = model(**inputs)
>>> prediction_logits = outputs.prediction_logits >>> prediction_logits = outputs.prediction_logits
>>> seq_relationship_logits = outputs.sop_logits >>> seq_relationship_logits = outputs.sop_logits
```
""" """
overwrite_call_docstring( overwrite_call_docstring(
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment