Fix copy image

This commit is contained in:
hlohaus
2025-06-19 10:40:36 +02:00
parent 4c387c9220
commit 90262b1f6a
2 changed files with 4 additions and 2 deletions

View File

@@ -133,7 +133,9 @@ class Backend_Api(Api):
json_data["provider"] = random.choice(models.demo_models[model][1]) json_data["provider"] = random.choice(models.demo_models[model][1])
else: else:
json_data["provider"] = models.HuggingFace json_data["provider"] = models.HuggingFace
debug.log("User:", request.headers.get("x_user", "unknown")) user = request.headers.get("Cf-Ipcountry", "")
ip = request.headers.get("X-Forwarded-For", "").split(":")[-1]
debug.log("User:", request.headers.get("x_user", f"{user}:{ip}"))
kwargs = self._prepare_conversation_kwargs(json_data) kwargs = self._prepare_conversation_kwargs(json_data)
return self.app.response_class( return self.app.response_class(
self._create_response_stream( self._create_response_stream(

View File

@@ -195,6 +195,6 @@ async def copy_media(
debug.error(f"Image copying failed:", e) debug.error(f"Image copying failed:", e)
if target_path and os.path.exists(target_path): if target_path and os.path.exists(target_path):
os.unlink(target_path) os.unlink(target_path)
return get_source_url(image, image) return image
return await asyncio.gather(*[copy_image(image, target) for image in images]) return await asyncio.gather(*[copy_image(image, target) for image in images])