[Styling] stylify using ruff (#27144)

* try to stylify using ruff

* might need to remove these changes?

* use ruf format andruff check

* use isinstance instead of type comparision

* use # fmt: skip

* use # fmt: skip

* nits

* soem styling changes

* update ci job

* nits isinstance

* more files update

* nits

* more nits

* small nits

* check and format

* revert wrong changes

* actually use formatter instead of checker

* nits

* well docbuilder is overwriting this commit

* revert notebook changes

* try to nuke docbuilder

* style

* fix feature exrtaction test

* remve `indent-width = 4`

* fixup

* more nits

* update the ruff version that we use

* style

* nuke docbuilder styling

* leve the print for detected changes

* nits

* Remove file I/O

Co-authored-by: charliermarsh
 <charlie.r.marsh@gmail.com>

* style

* nits

* revert notebook changes

* Add # fmt skip when possible

* Add # fmt skip when possible

* Fix

* More `  # fmt: skip` usage

* More `  # fmt: skip` usage

* More `  # fmt: skip` usage

* NIts

* more fixes

* fix tapas

* Another way to skip

* Recommended way

* Fix two more fiels

* Remove asynch
Remove asynch

---------

Co-authored-by: charliermarsh <charlie.r.marsh@gmail.com>
This commit is contained in:
Arthur
2023-11-16 17:43:19 +01:00
committed by GitHub
parent acb5b4aff5
commit 651408a077
480 changed files with 867 additions and 1059 deletions

View File

@@ -850,8 +850,9 @@ class TFWav2Vec2ModelIntegrationTest(unittest.TestCase):
input_values = inputs.input_values
attention_mask = inputs.attention_mask
outputs = model(input_values, attention_mask)
predicted_logits, predicted_ids = tf.math.reduce_max(outputs.logits, axis=-1), tf.argmax(
outputs.logits, axis=-1
predicted_logits, predicted_ids = (
tf.math.reduce_max(outputs.logits, axis=-1),
tf.argmax(outputs.logits, axis=-1),
)
expected_labels = [7, 6, 10, 9]
expected_logits = tf.convert_to_tensor([6.1186, 11.8961, 10.2931, 6.0898])
@@ -866,15 +867,18 @@ class TFWav2Vec2ModelIntegrationTest(unittest.TestCase):
input_values = inputs.input_values
attention_mask = inputs.attention_mask
outputs = model(input_values, attention_mask=attention_mask)
predicted_logits_action, predicted_ids_action = tf.math.reduce_max(outputs.logits[:, :6], axis=-1), tf.argmax(
outputs.logits[:, :6], axis=-1
predicted_logits_action, predicted_ids_action = (
tf.math.reduce_max(outputs.logits[:, :6], axis=-1),
tf.argmax(outputs.logits[:, :6], axis=-1),
)
predicted_logits_object, predicted_ids_object = (
tf.math.reduce_max(outputs.logits[:, 6:20], axis=-1),
tf.argmax(outputs.logits[:, 6:20], axis=-1),
)
predicted_logits_location, predicted_ids_location = (
tf.math.reduce_max(outputs.logits[:, 20:24], axis=-1),
tf.argmax(outputs.logits[:, 20:24], axis=-1),
)
predicted_logits_object, predicted_ids_object = tf.math.reduce_max(
outputs.logits[:, 6:20], axis=-1
), tf.argmax(outputs.logits[:, 6:20], axis=-1)
predicted_logits_location, predicted_ids_location = tf.math.reduce_max(
outputs.logits[:, 20:24], axis=-1
), tf.argmax(outputs.logits[:, 20:24], axis=-1)
expected_labels_action = [0, 0, 2, 3]
expected_logits_action = tf.convert_to_tensor([0.4568, 11.0848, 1.6621, 9.3841])
expected_labels_object = [3, 10, 3, 4]
@@ -915,8 +919,9 @@ class TFWav2Vec2ModelIntegrationTest(unittest.TestCase):
input_values = inputs.input_values
attention_mask = inputs.attention_mask
outputs = model(input_values, attention_mask=attention_mask)
predicted_logits, predicted_ids = tf.math.reduce_max(outputs.logits, axis=-1), tf.argmax(
outputs.logits, axis=-1
predicted_logits, predicted_ids = (
tf.math.reduce_max(outputs.logits, axis=-1),
tf.argmax(outputs.logits, axis=-1),
)
expected_labels = [1, 1, 2, 2]