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

Get the country of each session #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

SaulLu
Copy link
Collaborator

@SaulLu SaulLu commented Dec 7, 2021

As previously discussed, this PR comes shortly before the deadline: I leave you the choice to integrate it or not.

For your information, I tested to modify a trainer in a similar way by modifying the demo notebook of the HF trainer to check these changes. You can check it here.

Comment on lines +49 to +56
try:
response = urllib.request.urlopen(URL_IP_INFO)
data = json.load(response)
country = data["country"]
except Exception:
country = ""
return country

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that bare except is not a good practice, nevertheless I thought here that it was useless to risk to have an error at this level for this information which is only a "nice to have"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant