Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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