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

XFEstudio/gpt4free

Remove unused files

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

代码差异

16 个文件 +21 -191
Deleted .dockerignore +0 -1
@@ -1 +0,0 @@
1 projects/
Deleted .gitpod.yml +0 -7
@@ -1,7 +0,0 @@
1 # Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
2 # and commit this file to your remote git repository to share the goodness with others.
3
4 # Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart
5
6 tasks:
7 - init: pip install -r requirements.txt
Deleted .vscode/launch.json +0 -16
@@ -1,16 +0,0 @@
1 {
2 // Use IntelliSense to learn about possible attributes.
3 // Hover to view descriptions of existing attributes.
4 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 "version": "0.2.0",
6 "configurations": [
7
8
9 {
10 "name": "Python Debugger: Module",
11 "type": "debugpy",
12 "request": "launch",
13 "module": "etc.unittest"
14 }
15 ]
16 }
Deleted audio.m4a +0 -0
二进制文件已变更,无法进行逐行预览。
Deleted audio.wav +0 -0
二进制文件已变更,无法进行逐行预览。
Deleted deepseek4free +0 -1
@@ -1 +0,0 @@
1 Subproject commit c205cdfd240b87679111f62299cd4391566ca0db
Deleted downloads.json +0 -1
@@ -1 +0,0 @@
1 [{"urls": ["https://github.com/xtekky/gpt4free/compare/0.4.5.5...main"], "max_depth": -1}]
Modified g4f/Provider/Cloudflare.py +2 -2
@@ -88,8 +88,8 @@ class Cloudflare(AsyncGeneratorProvider, ProviderModelMixin, AuthFileMixin):
88 88 try:
89 89 task = asyncio.create_task(nodriver_read_models())
90 90 asyncio.run(task)
91 except RuntimeError:
92 debug.log("Nodriver is not available: RuntimeError")
91 except RuntimeError as e:
92 debug.log("Nodriver is not available:", e)
93 93 cls.models = cls.fallback_models
94 94 task.cancel()
95 95 else:
Modified g4f/Provider/PollinationsAI.py +4 -0
@@ -260,6 +260,7 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin):
260 260 private: bool = False,
261 261 enhance: bool = None,
262 262 safe: bool = False,
263 transparent: bool = False,
263 264 n: int = 1,
264 265 # Text generation parameters
265 266 media: MediaListType = None,
@@ -305,6 +306,7 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin):
305 306 private=private,
306 307 enhance=enhance,
307 308 safe=safe,
309 transparent=transparent,
308 310 n=n,
309 311 referrer=referrer,
310 312 api_key=api_key
@@ -359,6 +361,7 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin):
359 361 private: bool,
360 362 enhance: bool,
361 363 safe: bool,
364 transparent: bool,
362 365 n: int,
363 366 referrer: str,
364 367 api_key: str,
@@ -379,6 +382,7 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin):
379 382 image = [item[0] for item in media if isinstance(item[0], str) and item[0].startswith("http")] if media else []
380 383 params = {
381 384 **params,
385 "transparent": str(transparent).lower(),
382 386 "image": ",".join(image) if image else "",
383 387 }
384 388 else:
Modified g4f/Provider/PollinationsImage.py +2 -0
@@ -48,6 +48,7 @@ class PollinationsImage(PollinationsAI):
48 48 private: bool = False,
49 49 enhance: bool = False,
50 50 safe: bool = False,
51 transparent: bool = False,
51 52 n: int = 1,
52 53 **kwargs
53 54 ) -> AsyncResult:
@@ -67,6 +68,7 @@ class PollinationsImage(PollinationsAI):
67 68 private=private,
68 69 enhance=enhance,
69 70 safe=safe,
71 transparent=transparent,
70 72 n=n,
71 73 referrer=referrer,
72 74 api_key=api_key
Modified g4f/api/__init__.py +1 -1
@@ -701,7 +701,7 @@ class Api:
701 701 **({
702 702 "content-length": str(stat_result.st_size),
703 703 } if stat_result.st_size else {}),
704 **({} if mime_type is None else {
704 **({} if thumbnail or mime_type is None else {
705 705 "content-type": mime_type,
706 706 })
707 707 }
Modified g4f/providers/any_provider.py +1 -1
@@ -331,7 +331,7 @@ class AnyProvider(AsyncGeneratorProvider, ProviderModelMixin):
331 331 if api_key.get(provider):
332 332 if provider in __map__ and __map__[provider] not in PROVIERS_LIST_1:
333 333 extra_providers.append(__map__[provider])
334 print(f"Using extra providers: {[p.__name__ for p in extra_providers]}")
334 debug.log(f"Using extra providers: {[p.__name__ for p in extra_providers]}")
335 335 for provider in PROVIERS_LIST_1 + extra_providers:
336 336 if provider.working:
337 337 provider_api_key = api_key
Modified g4f/providers/base_provider.py +1 -1
@@ -35,7 +35,7 @@ SAFE_PARAMETERS = [
35 35 "api_key", "api_base", "seed", "width", "height",
36 36 "max_retries", "web_search",
37 37 "guidance_scale", "num_inference_steps", "randomize_seed",
38 "safe", "enhance", "private", "aspect_ratio", "n",
38 "safe", "enhance", "private", "aspect_ratio", "n", "transparent"
39 39 ]
40 40
41 41 BASIC_PARAMETERS = {
Modified g4f/tools/media.py +10 -1
@@ -3,6 +3,7 @@ from __future__ import annotations
3 3 import os
4 4 import base64
5 5 from typing import Iterator, Union
6 from urllib.parse import urlparse
6 7 from pathlib import Path
7 8
8 9 from ..typing import Messages
@@ -64,7 +65,15 @@ def merge_media(media: list, messages: list) -> Iterator:
64 65 path = render_media(**part, as_path=True)
65 66 buffer.append((path, os.path.basename(path)))
66 67 elif part.get("type") == "image_url":
67 buffer.append((part.get("image_url"), None))
68 path: str = urlparse(part.get("image_url")).path
69 if path.startswith("/files/"):
70 path = get_bucket_dir(path.split(path, "/")[1:])
71 if os.path.exists(path):
72 buffer.append((Path(path), os.path.basename(path)))
73 else:
74 buffer.append((part.get("image_url"), None))
75 else:
76 buffer.append((part.get("image_url"), None))
68 77 else:
69 78 buffer = []
70 79 yield from buffer
Deleted markitdown +0 -1
Deleted new.py +0 -158