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

XFEstudio/gpt4free

Update (g4f/models.py g4f/Provider/airforce/AirforceChat.py docs/providers-and-models.md)

82b8c22b
kqlio67 <kqlio67@users.noreply.github.com>
提交于

代码差异

4 个文件 +9 -17
Modified docs/providers-and-models.md +1 -1
@@ -20,7 +20,7 @@ This document provides an overview of various AI providers and models, including
20 20 |[ai4chat.co](https://www.ai4chat.co)|`g4f.Provider.Ai4Chat`|`gpt-4`|❌|❌|✔|![Active](https://img.shields.io/badge/Active-brightgreen)|❌|
21 21 |[aichatfree.info](https://aichatfree.info)|`g4f.Provider.AIChatFree`|`gemini-pro`|❌|❌|✔|![Active](https://img.shields.io/badge/Active-brightgreen)|❌|
22 22 |[aimathgpt.forit.ai](https://aimathgpt.forit.ai)|`g4f.Provider.AiMathGPT`|`llama-3.1-70b`|❌|❌|✔|![Active](https://img.shields.io/badge/Active-brightgreen)|❌|
23 |[api.airforce](https://api.airforce)|`g4f.Provider.Airforce`|`gpt-4o, gpt-4o-mini, gpt-4-turbo, llama-2-7b, llama-3.1-8b, llama-3.1-70b, hermes-2-pro, hermes-2-dpo, phi-2, deepseek-coder, openchat-3.5, openhermes-2.5, cosmosrp, lfm-40b, german-7b, zephyr-7b, neural-7b`|`flux, flux-realism', flux-anime, flux-3d, flux-disney, flux-pixel, flux-4o, any-dark, sdxl`|❌|✔|![Active](https://img.shields.io/badge/Active-brightgreen)|❌|
23 |[api.airforce](https://api.airforce)|`g4f.Provider.Airforce`|`gpt-4o, gpt-4o-mini, gpt-4-turbo, llama-2-7b, llama-3.1-8b, llama-3.1-70b, hermes-2-pro, hermes-2-dpo, phi-2, deepseek-coder, openchat-3.5, openhermes-2.5, lfm-40b, german-7b, zephyr-7b, neural-7b`|`flux, flux-realism', flux-anime, flux-3d, flux-disney, flux-pixel, flux-4o, any-dark, sdxl`|❌|✔|![Active](https://img.shields.io/badge/Active-brightgreen)|❌|
24 24 |[aiuncensored.info](https://www.aiuncensored.info)|`g4f.Provider.AIUncensored`|✔|✔|❌|✔|![Active](https://img.shields.io/badge/Active-brightgreen)|❌|
25 25 |[allyfy.chat](https://allyfy.chat/)|`g4f.Provider.Allyfy`|`gpt-3.5-turbo`|❌|❌|✔|![Active](https://img.shields.io/badge/Active-brightgreen)|❌|
26 26 |[bing.com](https://bing.com/chat)|`g4f.Provider.Bing`|`gpt-4`|✔|`gpt-4-vision`|✔|![Active](https://img.shields.io/badge/Active-brightgreen)|❌+✔|
Modified g4f/Provider/Airforce.py +1 -1
@@ -20,7 +20,7 @@ class Airforce(AsyncGeneratorProvider, ProviderModelMixin):
20 20 supports_message_history = AirforceChat.supports_message_history
21 21
22 22 default_model = AirforceChat.default_model
23 models = [*AirforceChat.text_models, *AirforceImage.image_models]
23 models = [*AirforceChat.models, *AirforceImage.models]
24 24
25 25 model_aliases = {
26 26 **AirforceChat.model_aliases,
Modified g4f/Provider/airforce/AirforceChat.py +6 -2
@@ -1,8 +1,8 @@
1 1 from __future__ import annotations
2 2 import re
3 3 import json
4 from aiohttp import ClientSession
5 4 import requests
5 from aiohttp import ClientSession
6 6 from typing import List
7 7
8 8 from ...typing import AsyncResult, Messages
@@ -21,7 +21,11 @@ def clean_response(text: str) -> str:
21 21 ]
22 22 for pattern in patterns:
23 23 text = re.sub(pattern, '', text)
24 return text.strip()
24
25 # Remove the <|im_end|> token if present
26 text = text.replace("<|im_end|>", "").strip()
27
28 return text
25 29
26 30 def split_message(message: str, max_length: int = 1000) -> List[str]:
27 31 """Splits the message into chunks of a given length (max_length)"""
Modified g4f/models.py +1 -13
@@ -463,15 +463,6 @@ openhermes_2_5 = Model(
463 463 best_provider = Airforce
464 464 )
465 465
466
467 ### Pawan ###
468 cosmosrp = Model(
469 name = 'cosmosrp',
470 base_provider = 'Pawan',
471 best_provider = Airforce
472 )
473
474
475 466 ### Liquid ###
476 467 lfm_40b = Model(
477 468 name = 'lfm-40b',
@@ -666,6 +657,7 @@ class ModelUtils:
666 657
667 658
668 659 ### Microsoft ###
660 'phi-2': phi_2,
669 661 'phi-3.5-mini': phi_3_5_mini,
670 662
671 663
@@ -764,10 +756,6 @@ class ModelUtils:
764 756 ### Teknium ###
765 757 'openhermes-2.5': openhermes_2_5,
766 758
767
768 ### Pawan ###
769 'cosmosrp': cosmosrp,
770
771 759
772 760 ### Liquid ###
773 761 'lfm-40b': lfm_40b,