question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add User-Agent header to all requests to the hub

See original GitHub issue

Is there a way to add huggingface_hub’s custom User-Agent to all the requests to the hub? Right now, it seems to be only in files_download. See here https://github.com/huggingface/huggingface_hub/blob/a1282ab170e6248a893764d5d6759efeaa7a5421/src/huggingface_hub/file_download.py#L317-L354

This would be useful to allow us to have more information about the client versions that use specific API endpoints (e.g: community, commit…).

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
Pierrcicommented, Aug 29, 2022

If we are talking about tracking just the version of huggingface_hub (+ML libs pytorch/keras/tf/fastai/…) that would be really straightforward to implement.

Yes! To clarify things, we’re solely interested in having this line or something similar for every call to the hub:

https://github.com/huggingface/huggingface_hub/blob/a1282ab170e6248a893764d5d6759efeaa7a5421/src/huggingface_hub/file_download.py#L340

0reactions
julien-ccommented, Aug 29, 2022

Agreed!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Include a User-Agent header in all requests
To create a User-Agent header, begin with the name of your application, followed by a forward slash, followed by the version of the...
Read more >
add User-Agent header to http requests · Issue #2860 - GitHub
Describe the problem you are trying to solve Hi rustup developers, currently the requests sent by rustup do not include User-Agent header.
Read more >
request.headers.User-Agent for Transaction table?
I noticed that on TransactionError we can get the request.headers.User-Agent value, which returns the full UserAgent information, ...
Read more >
How to add User-Agent header to HttpClient in .NET
If you wish to add the User-Agent header to a single HttpRequestMessage , this can be done like this: var httpClient = new...
Read more >
User-Agent Header - Tenable.io API
A standard User-Agent string helps Tenable to identify your integrations and API calls, and it assists with debugging and troubleshooting if you have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found