Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nazarov-yuriy/6e18a938b78528ee5cf4ed243315b428 to your computer and use it in GitHub Desktop.
Save nazarov-yuriy/6e18a938b78528ee5cf4ed243315b428 to your computer and use it in GitHub Desktop.
from pytorch_pretrained_bert.file_utils import url_to_filename
import requests
url = 'https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-pytorch_model.bin'
response = requests.head(url, allow_redirects=True)
etag = response.headers.get("ETag")
url_to_filename(url, etag)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment