From 7d1fa2c623db61bb9116abc8a059d464324b41c9 Mon Sep 17 00:00:00 2001 From: kqlio67 Date: Wed, 11 Sep 2024 15:54:26 +0300 Subject: refactor(g4f/Provider/ReplicateHome.py): optimize model organization and improve readability --- g4f/Provider/ReplicateHome.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'g4f') diff --git a/g4f/Provider/ReplicateHome.py b/g4f/Provider/ReplicateHome.py index c4e52ad6..d41633ba 100644 --- a/g4f/Provider/ReplicateHome.py +++ b/g4f/Provider/ReplicateHome.py @@ -15,16 +15,11 @@ class ReplicateHome(AsyncGeneratorProvider, ProviderModelMixin): parent = "Replicate" working = True default_model = 'meta/meta-llama-3-70b-instruct' + text_models = {"meta/meta-llama-3-70b-instruct", "mistralai/mixtral-8x7b-instruct-v0.1", "google-deepmind/gemma-2b-it"} + image_models = {"stability-ai/stable-diffusion-3", "bytedance/sdxl-lightning-4step", "playgroundai/playground-v2.5-1024px-aesthetic"} models = [ - # Models for image generation - 'stability-ai/stable-diffusion-3', - 'bytedance/sdxl-lightning-4step', - 'playgroundai/playground-v2.5-1024px-aesthetic', - - # Models for image generation - 'meta/meta-llama-3-70b-instruct', - 'mistralai/mixtral-8x7b-instruct-v0.1', - 'google-deepmind/gemma-2b-it', + *text_models, + *image_models ] versions = { @@ -51,9 +46,6 @@ class ReplicateHome(AsyncGeneratorProvider, ProviderModelMixin): ] } - image_models = {"stability-ai/stable-diffusion-3", "bytedance/sdxl-lightning-4step", "playgroundai/playground-v2.5-1024px-aesthetic"} - text_models = {"meta/meta-llama-3-70b-instruct", "mistralai/mixtral-8x7b-instruct-v0.1", "google-deepmind/gemma-2b-it"} - model_aliases = { "sd-3": "stability-ai/stable-diffusion-3", "sdxl": "bytedance/sdxl-lightning-4step", -- cgit v1.2.3