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

feat(fal/auth): add support for Google Colab token retrieval #389

Merged
merged 2 commits into from
Jan 21, 2025

Conversation

efiop
Copy link
Contributor

@efiop efiop commented Jan 20, 2025

Adapting #377 to work with sdk as well.

Kudos @not-lain

Copy link
Contributor

@not-lain not-lain left a comment

Choose a reason for hiding this comment

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

Clean PR, nice work @efiop !

Comment on lines +26 to +34
def is_google_colab() -> bool:
try:
from IPython import get_ipython

return "google.colab" in str(get_ipython())
except ModuleNotFoundError:
return False
except NameError:
return False
Copy link
Contributor

Choose a reason for hiding this comment

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

something I did not test yet is if this works with google colab pro as well ? (same with the client)

due to some issues in my country I can't access colab pro

this is how huggingface_hub handles it in case of any issues
https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/utils/_runtime.py#L296

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, interesting. I think I have access to Pro, so I'll try it out in a sec.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems to be working fine in pro.

@efiop
Copy link
Contributor Author

efiop commented Jan 20, 2025

3.12 tests are hanging up, probably unrelated. Investigating.

Adapting #377 to work with sdk as well.

Kudos @not-lain

Co-authored-by: Hafedh Hichri <70411813+not-lain@users.noreply.github.com>
@efiop efiop force-pushed the ruslan/not-lain/collab-secrets branch from 4489d56 to c384c06 Compare January 20, 2025 23:08
@efiop efiop force-pushed the ruslan/not-lain/collab-secrets branch from 22ca9a4 to 8d992f1 Compare January 21, 2025 13:46
@efiop efiop merged commit e9212ba into main Jan 21, 2025
10 checks passed
@efiop efiop deleted the ruslan/not-lain/collab-secrets branch January 21, 2025 13:51
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.

2 participants