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

XFEstudio/gpt4free

Fix copy image

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

代码差异

2 个文件 +4 -2
Modified g4f/gui/server/backend_api.py +3 -1
@@ -133,7 +133,9 @@ class Backend_Api(Api):
133 133 json_data["provider"] = random.choice(models.demo_models[model][1])
134 134 else:
135 135 json_data["provider"] = models.HuggingFace
136 debug.log("User:", request.headers.get("x_user", "unknown"))
136 user = request.headers.get("Cf-Ipcountry", "")
137 ip = request.headers.get("X-Forwarded-For", "").split(":")[-1]
138 debug.log("User:", request.headers.get("x_user", f"{user}:{ip}"))
137 139 kwargs = self._prepare_conversation_kwargs(json_data)
138 140 return self.app.response_class(
139 141 self._create_response_stream(
Modified g4f/image/copy_images.py +1 -1
@@ -195,6 +195,6 @@ async def copy_media(
195 195 debug.error(f"Image copying failed:", e)
196 196 if target_path and os.path.exists(target_path):
197 197 os.unlink(target_path)
198 return get_source_url(image, image)
198 return image
199 199
200 200 return await asyncio.gather(*[copy_image(image, target) for image in images])