Skip to content

Commit 022ce44

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6bc2f47 commit 022ce44

File tree

90 files changed

+30311
-29782
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+30311
-29782
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
> [!IMPORTANT]
1+
> [!IMPORTANT]
22
The original authors have moved on to other projects. While the code might still be functional for its original purpose, please be aware that the original team does not plan to develop new features, bug fixes, or updates. If you'd like to become a maintainer, please open an issue to discuss it.
3-
>
3+
>
44
<h1 align="center">
55
<a href=""><img src="https://github.com/dvsrepo/imgs/raw/main/rg.svg" alt="Argilla" width="150"></a>
66
<br>

argilla-server/src/argilla_server/_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def _show_telemetry_warning():
298298
" https://docs.argilla.io/latest/reference/argilla-server/telemetry/\n\n"
299299
"Telemetry is currently enabled. If you want to disable it, you can configure\n"
300300
"the environment variable before relaunching the server:\n\n"
301-
f'{"#set HF_HUB_DISABLE_TELEMETRY=1" if os.name == "nt" else "$>export HF_HUB_DISABLE_TELEMETRY=1"}'
301+
f"{'#set HF_HUB_DISABLE_TELEMETRY=1' if os.name == 'nt' else '$>export HF_HUB_DISABLE_TELEMETRY=1'}"
302302
)
303303
_LOGGER.warning(message)
304304

argilla-v1/src/argilla_v1/client/datasets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ def _prepare_for_training_with_spacy(self, nlp: "spacy.Language", records: List[
11561156
raise ValueError(
11571157
"The following annotation does not align with the tokens"
11581158
" produced by the provided spacy language model:"
1159-
f" {(anno[0], record.text[anno[1]:anno[2]])}, {list(doc)}"
1159+
f" {(anno[0], record.text[anno[1] : anno[2]])}, {list(doc)}"
11601160
)
11611161
else:
11621162
entities.append(span)

argilla-v1/src/argilla_v1/client/feedback/dataset/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def normalize_records(
169169
new_records.append(record)
170170
else:
171171
raise ValueError(
172-
"Expected `records` to be a list of `dict` or `FeedbackRecord`," f" got type `{type(record)}` instead."
172+
f"Expected `records` to be a list of `dict` or `FeedbackRecord`, got type `{type(record)}` instead."
173173
)
174174
return new_records
175175

@@ -384,7 +384,7 @@ def _validate_record_metadata(record: FeedbackRecord, metadata_schema: typing.Ty
384384
metadata_schema.parse_obj(record.metadata)
385385
except ValidationError as e:
386386
raise ValueError(
387-
f"`FeedbackRecord.metadata` {record.metadata} does not match the expected schema," f" with exception: {e}"
387+
f"`FeedbackRecord.metadata` {record.metadata} does not match the expected schema, with exception: {e}"
388388
) from e
389389

390390

argilla-v1/src/argilla_v1/client/feedback/dataset/local/dataset.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def __getitem__(self, key: Union[slice, int]) -> Union["FeedbackRecord", List["F
230230
"""
231231
if len(self._records) < 1:
232232
raise RuntimeError(
233-
"In order to get items from `FeedbackDataset` you need to add them first" " with `add_records`."
233+
"In order to get items from `FeedbackDataset` you need to add them first with `add_records`."
234234
)
235235
if isinstance(key, int) and len(self._records) < key:
236236
raise IndexError(f"This dataset contains {len(self)} records, so index {key} is out of range.")
@@ -331,8 +331,7 @@ def delete_vectors_settings(
331331

332332
if not self.vectors_settings:
333333
raise ValueError(
334-
"The current `FeedbackDataset` does not contain any `vectors_settings` defined, so"
335-
" none can be deleted."
334+
"The current `FeedbackDataset` does not contain any `vectors_settings` defined, so none can be deleted."
336335
)
337336

338337
if not all(vector_setting in self._vectors_settings.keys() for vector_setting in vectors_settings):

argilla-v1/src/argilla_v1/client/feedback/dataset/local/mixins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __delete_dataset(client: "httpx.Client", id: UUID) -> None:
8989
datasets_api_v1.delete_dataset(client=client, id=id)
9090
except Exception as e:
9191
raise Exception(
92-
f"Failed while deleting the `FeedbackDataset` with ID '{id}' from Argilla with" f" exception: {e}"
92+
f"Failed while deleting the `FeedbackDataset` with ID '{id}' from Argilla with exception: {e}"
9393
) from e
9494

9595
@staticmethod

argilla-v1/src/argilla_v1/client/feedback/integrations/huggingface/model_card/model_card.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def generate(model_id: str, instruction: str, context: str = "") -> str:
422422
)
423423
return tokenizer.decode(outputs[0])
424424
425-
generate("{self.output_dir.replace('"', '')}", "Is a toad a frog?")"""
425+
generate("{self.output_dir.replace('"', "")}", "Is a toad a frog?")"""
426426
)
427427
elif self.task_type == "for_reward_modeling":
428428
return predict_call + dedent(

argilla-v1/src/argilla_v1/client/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def __init__(
424424
raise AssertionError("Missing fields: At least one of `text` or `tokens` argument must be provided!")
425425

426426
if (data.get("annotation") or data.get("prediction")) and text is None:
427-
raise AssertionError("Missing field `text`: " "char level spans must be provided with a raw text sentence")
427+
raise AssertionError("Missing field `text`: char level spans must be provided with a raw text sentence")
428428

429429
if text is None:
430430
text = " ".join(tokens)

argilla-v1/src/argilla_v1/client/sdk/commons/errors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(self, message: str, response: Any):
2626
self.response = response
2727

2828
def __str__(self):
29-
return f"\nUnexpected response: {self.message}" "\nResponse content:" f"\n{self.response}"
29+
return f"\nUnexpected response: {self.message}\nResponse content:\n{self.response}"
3030

3131

3232
class InputValueError(BaseClientError):
@@ -52,7 +52,7 @@ def __init__(self, **ctx):
5252
self.ctx = ctx
5353

5454
def __str__(self):
55-
return f"Argilla server returned an error with http status: {self.HTTP_STATUS}. " f"Error details: {self.ctx!r}"
55+
return f"Argilla server returned an error with http status: {self.HTTP_STATUS}. Error details: {self.ctx!r}"
5656

5757

5858
class BadRequestApiError(ArApiResponseError):

argilla-v1/src/argilla_v1/client/workspaces.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ def users(self) -> List["UserModel"]:
120120

121121
def __repr__(self) -> str:
122122
return (
123-
f"Workspace(id={self.id}, name={self.name},"
124-
f" inserted_at={self.inserted_at}, updated_at={self.updated_at})"
123+
f"Workspace(id={self.id}, name={self.name}, inserted_at={self.inserted_at}, updated_at={self.updated_at})"
125124
)
126125

127126
@allowed_for_roles(roles=[UserRole.owner])
@@ -330,8 +329,7 @@ def from_id(cls, id: UUID) -> "Workspace":
330329
) from e
331330
except ValidationApiError as e:
332331
raise ValueError(
333-
"The ID you provided is not a valid UUID, so please make sure that the"
334-
" ID you provided is a valid one."
332+
"The ID you provided is not a valid UUID, so please make sure that the ID you provided is a valid one."
335333
) from e
336334
except BaseClientError as e:
337335
raise RuntimeError(f"Error while retrieving workspace with id=`{id}` from Argilla.") from e

0 commit comments

Comments
 (0)