mrdbourke / pytorch-deep-learning

Materials for the Learn PyTorch for Deep Learning: Zero to Mastery course.
https://learnpytorch.io
MIT License
9.34k stars 2.78k forks source link

Helper Function github link requests error #995

Closed Syed-Tangim-Pasha closed 1 week ago

Syed-Tangim-Pasha commented 1 week ago

I tried to use the helper function through your GitHub link using the raw files URL, but it showed an error. Could you please help me with the problem related to the below issue and how I can resolve it?

Code:

import requests from pathlib import Path

url="https://raw.githubusercontent.com/mrdbourke/pytorch-deep-learning/main/helper_functions.py"

Download helper functions from Learn PyTorch repo (if not already downloaded)

if Path("helper_functions.py").is_file(): print("helper_functions.py already exists, skipping download") else: print("Downloading helper_functions.py") request = requests.get(url) with open("helper_functions.py", "wb") as f: f.write(request.content)

from helper_functions import plot_predictions, plot_decision_boundary

Error Messages:

helper_functions.py already exists, skipping download Traceback (most recent call last):

File "/content/helper_functions.py", line 112

pytorch-deep-learning/helper_functions.py at main · mrdbourke/pytorch-deep-learning · GitHub
                                                         ^

SyntaxError: invalid character '·' (U+00B7)

pritesh2000 commented 1 week ago

It is not link related error you might type somewhere '.' without knowing and that is causing it.

You can use ``` (button before 1 thrice) before and after code to make code snippet like this

print("Hello world")

can you add screenshot here?

Syed-Tangim-Pasha commented 1 week ago

It is not link related error you might type somewhere '.' without knowing and that is causing it.

You can use ``` (button before 1 thrice) before and after code to make code snippet like this

print("Hello world")

can you add screenshot here?