"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "e118e085eabdc95f0c9b8c66058308dd1a367ee3"
Unverified Commit f374d391 authored by Tom Mathews's avatar Tom Mathews Committed by GitHub
Browse files

Adding type hints of TF:OpenAIGPT (#18263)

parent 5bb211be
...@@ -239,17 +239,17 @@ class TFOpenAIGPTMainLayer(tf.keras.layers.Layer): ...@@ -239,17 +239,17 @@ class TFOpenAIGPTMainLayer(tf.keras.layers.Layer):
@unpack_inputs @unpack_inputs
def call( def call(
self, self,
input_ids=None, input_ids: Optional[TFModelInputType] = None,
attention_mask=None, attention_mask: Optional[Union[np.ndarray, tf.Tensor]] = None,
token_type_ids=None, token_type_ids: Optional[Union[np.ndarray, tf.Tensor]] = None,
position_ids=None, position_ids: Optional[Union[np.ndarray, tf.Tensor]] = None,
head_mask=None, head_mask: Optional[Union[np.ndarray, tf.Tensor]] = None,
inputs_embeds=None, inputs_embeds: Optional[Union[np.ndarray, tf.Tensor]] = None,
output_attentions=None, output_attentions: Optional[bool] = None,
output_hidden_states=None, output_hidden_states: Optional[bool] = None,
return_dict=None, return_dict: Optional[bool] = None,
training=False, training: Optional[bool] = False,
): ) -> Union[Tuple, TFBaseModelOutput]:
if input_ids is not None and inputs_embeds is not None: if input_ids is not None and inputs_embeds is not None:
raise ValueError("You cannot specify both input_ids and inputs_embeds at the same time") raise ValueError("You cannot specify both input_ids and inputs_embeds at the same time")
......
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