"...text-generation-inference.git" did not exist on "37b64a5c10a87f25b5de1c3c55f3ea965104f290"
Unverified Commit 4150ceae authored by Philip Meier's avatar Philip Meier Committed by GitHub
Browse files

fix check for exceeded quota on Google Drive (#3710)

* fix check for exceeded quota on Google Drive

* safeguard quota exceed check
parent 97b6b150
......@@ -175,9 +175,11 @@ def list_files(root: str, suffix: str, prefix: bool = False) -> List[str]:
def _quota_exceeded(response: "requests.models.Response") -> bool: # type: ignore[name-defined]
return False
# See https://github.com/pytorch/vision/issues/2992 for details
# return "Google Drive - Quota exceeded" in response.text
try:
start = next(response.iter_content(chunk_size=128, decode_unicode=True))
return isinstance(start, str) and "Google Drive - Quota exceeded" in start
except StopIteration:
return False
def download_file_from_google_drive(file_id: str, root: str, filename: Optional[str] = None, md5: Optional[str] = None):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment