Compare commits

...

3 commits

Author SHA1 Message Date
hlohaus
9c7fc9fe4a Remove version declaration from Docker Compose files and update Dockerfile to streamline package installation 2025-11-14 19:52:57 +01:00
H Lohaus
f8978c1437
Update Dockerfile 2025-11-14 18:24:28 +01:00
hlohaus
fb26557dbb Fix model retrieval process in AnyModelProviderMixin
- Added error handling around model retrieval to prevent crashes when a provider fails.
- Ensured that exceptions during model fetching are logged for debugging purposes.
- Cleaned up the indentation and structure of the model retrieval logic for better readability.
2025-11-14 17:24:28 +01:00
5 changed files with 2402 additions and 1190 deletions

View file

@ -1,5 +1,3 @@
version: '3'
services:
g4f-slim:
container_name: g4f-slim

View file

@ -1,5 +1,3 @@
version: '3'
services:
gpt4free:
image: hlohaus789/g4f:latest

File diff suppressed because one or more lines are too long

View file

@ -195,6 +195,7 @@ class AnyModelProviderMixin(ProviderModelMixin):
cls.video_models.extend([clean_name(model) for model in provider.video_models])
for provider in Provider.__providers__:
try:
if provider.working and hasattr(provider, "get_models") and provider not in [AnyProvider, Custom, PollinationsImage, OpenaiAccount]:
for model in provider.get_models():
clean = clean_name(model)
@ -207,6 +208,9 @@ class AnyModelProviderMixin(ProviderModelMixin):
for model in cls.model_map.keys():
if "gemini" in model or "gemma" in model:
cls.model_map[alias].update({provider.__name__: model})
except Exception as e:
debug.error(f"Error getting models for provider {provider.__name__}:", e)
continue
# Process audio providers
for provider in [Microsoft_Phi_4_Multimodal, PollinationsAI]:
@ -220,7 +224,6 @@ class AnyModelProviderMixin(ProviderModelMixin):
cls.video_models.append("video")
cls.model_map["video"] = {"Video": "video"}
del cls.model_map[""]
cls.audio_models = [*cls.audio_models]
# Create a mapping of parent providers to their children

View file

@ -18,4 +18,3 @@ python-multipart
a2wsgi
python-dotenv
ddgs
aiofile