mirror of
https://github.com/DS4SD/docling.git
synced 2025-08-02 15:32:30 +00:00
allow only localhost traffic
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
parent
8ac000e35e
commit
15e18f5903
@ -53,6 +53,12 @@ class PictureDescriptionApiModel(PictureDescriptionBaseModel):
|
|||||||
super().__init__(enabled=enabled, options=options)
|
super().__init__(enabled=enabled, options=options)
|
||||||
self.options: PicDescApiOptions
|
self.options: PicDescApiOptions
|
||||||
|
|
||||||
|
if self.enabled:
|
||||||
|
if options.url.host != "localhost":
|
||||||
|
raise NotImplementedError(
|
||||||
|
"The options try to connect to remote APIs which are not yet allowed."
|
||||||
|
)
|
||||||
|
|
||||||
def _annotate_images(self, images: Iterable[Image.Image]) -> Iterable[str]:
|
def _annotate_images(self, images: Iterable[Image.Image]) -> Iterable[str]:
|
||||||
# Note: technically we could make a batch request here,
|
# Note: technically we could make a batch request here,
|
||||||
# but not all APIs will allow for it. For example, vllm won't allow more than 1.
|
# but not all APIs will allow for it. For example, vllm won't allow more than 1.
|
||||||
|
Loading…
Reference in New Issue
Block a user