[pre-commit.ci] pre-commit autoupdate (#176)

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 23.12.1 → 24.1.1](https://github.com/psf/black/compare/23.12.1...24.1.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Этот коммит содержится в:
pre-commit-ci[bot] 2024-01-31 14:17:29 +01:00 коммит произвёл GitHub
родитель f128fa4754
Коммит b4aae9321c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 27 добавлений и 19 удалений

Просмотреть файл

@ -5,7 +5,7 @@ repos:
- id: nbstripout
files: ".ipynb"
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/pycqa/flake8

Просмотреть файл

@ -479,12 +479,16 @@ class AnalysisExplorer:
detector_class = identify_function(
image_copy,
analyse_text=analyse_text,
model_names=[settings_text_model_names]
if (settings_text_model_names is not None)
else None,
revision_numbers=[settings_text_revision_numbers]
if (settings_text_revision_numbers is not None)
else None,
model_names=(
[settings_text_model_names]
if (settings_text_model_names is not None)
else None
),
revision_numbers=(
[settings_text_revision_numbers]
if (settings_text_revision_numbers is not None)
else None
),
)
elif detector_value == "EmotionDetector":
detector_class = identify_function(
@ -502,9 +506,11 @@ class AnalysisExplorer:
image_copy,
analysis_type=setting_summary_analysis_type,
model_type=setting_summary_model,
list_of_questions=[setting_summary_list_of_questions]
if (setting_summary_list_of_questions is not None)
else None,
list_of_questions=(
[setting_summary_list_of_questions]
if (setting_summary_list_of_questions is not None)
else None
),
)
else:
detector_class = identify_function(image_copy)

Просмотреть файл

@ -534,9 +534,9 @@ class MultimodalSearch(AnalysisMethod):
self.subdict[image_keys[key]][
"rank " + list(search_query[q].values())[0]
] = places[q][key]
self.subdict[image_keys[key]][
list(search_query[q].values())[0]
] = similarity[key][q].item()
self.subdict[image_keys[key]][list(search_query[q].values())[0]] = (
similarity[key][q].item()
)
else:
self.subdict[image_keys[key]][
"rank " + list(search_query[q].values())[0]
@ -915,9 +915,9 @@ class MultimodalSearch(AnalysisMethod):
avg_gradcams.append(local_avg_gradcams)
itm_scores.append(local_itm_scores)
itm_scores2.append(local_itm_scores2)
image_gradcam_with_itm[
list(search_query[index_text_query].values())[0]
] = localimage_gradcam_with_itm
image_gradcam_with_itm[list(search_query[index_text_query].values())[0]] = (
localimage_gradcam_with_itm
)
del (
itm_model,
vis_processor_itm,

Просмотреть файл

@ -220,9 +220,11 @@ class TextDetector(AnalysisMethod):
"""Clean the text from unrecognized words and any numbers."""
templist = []
for token in self.doc:
templist.append(
token.text
) if token.pos_ != "NUM" and token.has_vector else None
(
templist.append(token.text)
if token.pos_ != "NUM" and token.has_vector
else None
)
self.subdict["text_clean"] = " ".join(templist).rstrip().lstrip()
def text_summary(self):