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

Fetch files if running in google colab #20

Merged
merged 2 commits into from
Jan 22, 2025
Merged

Fetch files if running in google colab #20

merged 2 commits into from
Jan 22, 2025

Conversation

sean-smith
Copy link
Collaborator

@sean-smith sean-smith commented Jan 22, 2025

This adds in blocks similar to the following, which is useful when running in colab as opposed to locally.

if not os.path.exists('data/fin_train.jsonl'):
    print(f"Fetching data/fin_train.jsonl")
    response = requests.get("https://raw.githubusercontent.com/ContextualAI/examples/refs/heads/main/01-getting-started/data/fin_train.jsonl")
    with open('data/fin_train.jsonl', 'wb') as f:
        f.write(response.content)

Signed-off-by: Sean Smith <sean.smith@contextual.ai>
@sean-smith sean-smith requested a review from rajshah4 January 22, 2025 18:45
Signed-off-by: Sean Smith <sean.smith@contextual.ai>
@sean-smith sean-smith changed the title wget files for getting-started Fetch files if running in google colab Jan 22, 2025
@sean-smith sean-smith merged commit c1ddccd into main Jan 22, 2025
1 check passed
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