diff --git a/llm/models.py b/llm/models.py index 892a4f2ba..2ec41b119 100644 --- a/llm/models.py +++ b/llm/models.py @@ -84,7 +84,7 @@ def resolve_type(self): if self.path: return mimetype_from_path(self.path) if self.url: - response = httpx.head(self.url) + response = httpx.head(self.url, follow_redirects=True, timeout=30.0) response.raise_for_status() return response.headers.get("content-type") if self.content: @@ -98,7 +98,7 @@ def content_bytes(self): if self.path: content = Path(self.path).read_bytes() elif self.url: - response = httpx.get(self.url) + response = httpx.get(self.url, follow_redirects=True, timeout=30.0) response.raise_for_status() content = response.content return content