mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-10-05 08:16:58 +08:00
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:
@@ -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:
|
||||
|
Reference in New Issue
Block a user