Skip to content

DPO notebook: colab pkg missing #634

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

Closed
d-kleine opened this issue Apr 24, 2025 · 2 comments
Closed

DPO notebook: colab pkg missing #634

d-kleine opened this issue Apr 24, 2025 · 2 comments
Assignees

Comments

@d-kleine
Copy link
Contributor

d-kleine commented Apr 24, 2025

Bug description

As google.colab will be imported for the use of the colab GPU:

I think it might be useful to add colab to the package installation at the every top of the notebook

What operating system are you using?

None

Where do you run your code?

None

Environment




@d-kleine d-kleine added the bug Something isn't working label Apr 24, 2025
@rasbt
Copy link
Owner

rasbt commented Apr 25, 2025

Unless I am missing something, it is only conditionally executed (for a subset of users who use Colab) via:

    # If this notebook is run on Google Colab, get it from a Google Drive folder
    elif "COLAB_GPU" in os.environ or "COLAB_TPU_ADDR" in os.environ:
        from google.colab import drive
        drive.mount("/content/drive")
        google_drive_path = "/content/drive/My Drive/Books/LLMs-From-Scratch/ch07/colab/gpt2-medium355M-sft.pth"  # Readers need to adjust this path
        shutil.copy(google_drive_path, ".")

but then if it is executed in a Google Colab notebook, the google.colab library should already be pre-installed there, so I don't think it's necessary to add this to the installation. Otherwise, people might think they have to install it themselves. Any thoughts?

@rasbt rasbt removed the bug Something isn't working label Apr 25, 2025
@d-kleine
Copy link
Contributor Author

Ah, I see – yeah, you are right! All good then! 🙂

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

No branches or pull requests

2 participants