"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "d0b3797a3be095f74659341ed396cc8bccff96f6"
Unverified Commit 625f512d authored by chenht2010's avatar chenht2010 Committed by GitHub
Browse files

[TFWav2Vec2] Fix docs (#12283)



* fix error

* make style check happy
Co-authored-by: default avatarchenhaitao <chenhaitao@qiyi.com>
parent 44739c81
......@@ -1523,7 +1523,8 @@ class TFWav2Vec2ForCTC(TFWav2Vec2PreTrainedModel):
>>> ds = ds.map(map_to_array)
>>> input_values = processor(ds["speech"][0], return_tensors="tf").input_values # Batch size 1
>>> logits = model(input_values).logits >>> predicted_ids = tf.argmax(logits, axis=-1)
>>> logits = model(input_values).logits
>>> predicted_ids = tf.argmax(logits, axis=-1)
>>> transcription = processor.decode(predicted_ids[0])
......@@ -1532,7 +1533,7 @@ class TFWav2Vec2ForCTC(TFWav2Vec2PreTrainedModel):
>>> # wrap processor as target processor to encode labels
>>> with processor.as_target_processor():
>>> labels = processor(transcription, return_tensors="tf").input_values
>>> labels = processor(transcription, return_tensors="tf").input_ids
>>> loss = model(input_values, labels=labels).loss
"""
......
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