@@ -749,8 +749,6 @@ msgid "Available only in paid plan" msgstr "Доступно только в платном тарифе" #: ml_model/exceptions.py:163 -#, fuzzy -#| msgid "Image analysis error. Please try another image." msgid "Face not found in the image. Please try another image with a face." msgstr "Не найдено лицо на картинке. Попробуйте другую картинку с лицом." @@ -8,7 +8,6 @@ import requests from django.core.files import File from messages.models import Message -from ml_model.exceptions import RequestBlocked, PredictionInterruptedError, GenerationException from ml_model.models import ( NeuronModel, ) @@ -87,17 +86,10 @@ class Flux(SimpleService): **input_message.info, } ) - try: - runner = replicate_run( - f'{self._CALLBACK_BASE}{callback_data.get("version", "flux-schnell")}', - callback_data, - ) - except Exception as exc: - if any(error in str(exc) for error in ('E005', 'E006', 'sexual', 'NSFW')): - raise RequestBlocked - elif 'PA' in str(exc): - raise PredictionInterruptedError - raise GenerationException from exc + runner = replicate_run( + f'{self._CALLBACK_BASE}{callback_data.get("version", "flux-schnell")}', + callback_data, + ) images = runner if isinstance(runner, list) else [runner] process_time = timedelta(seconds=(time.time() - start_time)) self.handle_invoice(input_message.content_object.model, input_message=input_message, version=version)