Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support proxy and user-agent in fsspec calls #6046

Open
lhoestq opened this issue Jul 17, 2023 · 8 comments
Open

Support proxy and user-agent in fsspec calls #6046

lhoestq opened this issue Jul 17, 2023 · 8 comments
Assignees
Labels
enhancement New feature or request good second issue Issues a bit more difficult than "Good First" issues

Comments

@lhoestq
Copy link
Member

lhoestq commented Jul 17, 2023

Since we switched to the new HfFileSystem we no longer apply user's proxy and user-agent.

Using the HTTP_PROXY and HTTPS_PROXY environment variables works though since we use aiohttp to call the HF Hub.

This can be implemented in _prepare_single_hop_path_and_storage_options.

Though ideally the HfFileSystem could support passing at least the proxies

@lhoestq lhoestq added enhancement New feature or request good second issue Issues a bit more difficult than "Good First" issues labels Jul 17, 2023
@lhoestq lhoestq mentioned this issue Jul 17, 2023
@zutarich
Copy link

zutarich commented Oct 9, 2023

hii @lhoestq can you assign this issue to me?

@lhoestq
Copy link
Member Author

lhoestq commented Oct 9, 2023

You can reply "#self-assign" to this issue to automatically get assigned to it :)
Let me know if you have any questions or if I can help

@zutarich
Copy link

zutarich commented Oct 9, 2023

#2289

@zutarich
Copy link

zutarich commented Oct 9, 2023

Actually i am quite new to figure it out how everything goes and done

You can reply "#self-assign" to this issue to automatically get assigned to it :)
Let me know if you have any questions or if I can help

when i wrote #self-assign it automatically got converted to some number is it correct or i have done it some wrong way, I am quite new to open source thus wanna try to learn and explore it

@zutarich
Copy link

zutarich commented Oct 9, 2023

#2289 #self-assign

@lhoestq
Copy link
Member Author

lhoestq commented Oct 9, 2023

Ah yea github tries to replace the #self-assign with an issue link. I guess you can try to copy-paste instead to see if it works

Anyway let me assign you manually

@zutarich
Copy link

zutarich commented Oct 9, 2023

thanks a lot @lhoestq ! though i have a very lil idea of the issue, i am new. as i said before, but gonna try my best shot to do it.
can you please suggest some tips or anything from your side, how basically we approach it will be really helpfull.
Will try my best!

@lhoestq
Copy link
Member Author

lhoestq commented Oct 9, 2023

The HfFileSystem from the huggingface_hub package can already read the HTTP_PROXY and HTTPS_PROXY environment variables. So the remaining thing missing is the user_agent that the user may include in a DownloadConfig object. The user agent can be used for regular http calls but also calls to the HfFileSystem.

  • for http, the user_agent isn't passed from DownloadConfig to get_datasets_user_agent in _prepare_single_hop_path_and_storage_options in streaming_download_manager.py so we need to include it
  • for HfFileSystem I think it requires a PR in https://github.com/huggingface/huggingface_hub to include it in the HfFileSystem.__init__

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good second issue Issues a bit more difficult than "Good First" issues
Projects
None yet
Development

No branches or pull requests

2 participants