XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

refactor: update model filtering logic in get_models method

- Modified `get_models` method in `TypeGPT` class in `g4f/Provider/TypeGPT.py` - Changed model filtering condition to exclude models starting with `-` instead of including only those starting with `+` - Replaced `model.split("@")[0][1:]` with `model.split("@")[0].strip("+")` to extract model name without leading `+

a3e47f0e
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +1 -1
Modified g4f/Provider/TypeGPT.py +1 -1
@@ -37,5 +37,5 @@ class TypeGPT(OpenaiTemplate):
37 37 def get_models(cls, **kwargs):
38 38 if not cls.models:
39 39 cls.models = requests.get(f"{cls.url}/api/config").json()["customModels"].split(",")
40 cls.models = [model.split("@")[0][1:] for model in cls.models if model.startswith("+") and model not in cls.image_models]
40 cls.models = [model.split("@")[0].strip("+") for model in cls.models if not model.startswith("-") and model not in cls.image_models]
41 41 return cls.models