Commit
·
1b21789
1
Parent(s):
ec4d2f7
- hf_backend.py +10 -0
hf_backend.py
CHANGED
|
@@ -112,3 +112,13 @@ class HFChatBackend(ChatBackend):
|
|
| 112 |
{"index": 0, "delta": {"content": text}, "finish_reason": "stop"}
|
| 113 |
],
|
| 114 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
{"index": 0, "delta": {"content": text}, "finish_reason": "stop"}
|
| 113 |
],
|
| 114 |
}
|
| 115 |
+
class StubImagesBackend(ImagesBackend):
|
| 116 |
+
"""
|
| 117 |
+
Stub backend for images since HFChatBackend is text-only.
|
| 118 |
+
Returns a transparent 1x1 PNG placeholder.
|
| 119 |
+
"""
|
| 120 |
+
async def generate_b64(self, request: Dict[str, Any]) -> str:
|
| 121 |
+
logger.warning("Image generation not supported in HF backend.")
|
| 122 |
+
return (
|
| 123 |
+
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGP4BwQACfsD/etCJH0AAAAASUVORK5CYII="
|
| 124 |
+
)
|