refac/fix: marker

This commit is contained in:
Timothy Jaeryang Baek 2025-08-28 03:03:31 +04:00
parent 4d7c8b4a6a
commit 2bb6063dcb
2 changed files with 3 additions and 3 deletions

View file

@ -64,7 +64,7 @@ class DatalabMarkerLoader:
return mime_map.get(ext, "application/octet-stream") return mime_map.get(ext, "application/octet-stream")
def check_marker_request_status(self, request_id: str) -> dict: def check_marker_request_status(self, request_id: str) -> dict:
url = f"{self.api_base_url}/marker/{request_id}" url = f"{self.api_base_url}/{request_id}"
headers = {"X-Api-Key": self.api_key} headers = {"X-Api-Key": self.api_key}
try: try:
response = requests.get(url, headers=headers) response = requests.get(url, headers=headers)
@ -111,7 +111,7 @@ class DatalabMarkerLoader:
with open(self.file_path, "rb") as f: with open(self.file_path, "rb") as f:
files = {"file": (filename, f, mime_type)} files = {"file": (filename, f, mime_type)}
response = requests.post( response = requests.post(
f"{self.api_base_url}/marker", f"{self.api_base_url}",
data=form_data, data=form_data,
files=files, files=files,
headers=headers, headers=headers,

View file

@ -284,7 +284,7 @@ class Loader:
): ):
api_base_url = self.kwargs.get("DATALAB_MARKER_API_BASE_URL", "") api_base_url = self.kwargs.get("DATALAB_MARKER_API_BASE_URL", "")
if not api_base_url or api_base_url.strip() == "": if not api_base_url or api_base_url.strip() == "":
api_base_url = "https://www.datalab.to/api/v1" api_base_url = "https://www.datalab.to/api/v1/marker" # https://github.com/open-webui/open-webui/pull/16867#issuecomment-3218424349
loader = DatalabMarkerLoader( loader = DatalabMarkerLoader(
file_path=file_path, file_path=file_path,