feat: Refactor PollinationsAI and ARTA provider structure

- Updated `PollinationsAI.py` to strip trailing periods and newlines from the prompt before encoding.
- Modified the encoding of the prompt to remove trailing percent signs after URL encoding.
- Simplified the audio response handling in `PollinationsAI.py` by removing unnecessary checks and yielding chunks directly.
- Renamed `ARTA.py` to `deprecated/ARTA.py` and updated import paths accordingly in `__init__.py`.
- Changed the `working` status of the `ARTA` class to `False` to indicate it is deprecated.
- Enhanced the `Video` class in `Video.py` to include aspect ratio handling and improved URL response caching.
- Updated the `RequestConfig` class to use a dictionary for storing URLs associated with prompts.
- Removed references to the `ARTA` provider in various files, including `models.py` and `any_provider.py`.
- Adjusted the `best_provider` assignments in `models.py` to exclude `ARTA` and include `HuggingFaceMedia` where applicable.
- Updated the response handling in `Video.py` to yield cached responses when available.
This commit is contained in:
hlohaus
2025-06-19 00:42:41 +02:00
parent faf94ccfbb
commit d824d77d65
11 changed files with 106 additions and 87 deletions

View File

@@ -386,12 +386,14 @@ class Backend_Api(Api):
process_image(image, save=os.path.join(thumbnail_dir, filename))
except Exception as e:
logger.exception(e)
elif is_supported:
elif is_supported and not result:
newfile = os.path.join(bucket_dir, filename)
filenames.append(filename)
else:
os.remove(copyfile)
raise ValueError(f"Unsupported file type: {filename}")
if not result:
raise ValueError(f"Unsupported file type: {filename}")
continue
try:
os.rename(copyfile, newfile)
except OSError: