Giter VIP home page Giter VIP logo

Comments (7)

HHousen avatar HHousen commented on May 31, 2024 1

Correct me if I'm wrong, but I believe it works if you import everything from the lecture2notes namespace. Does it work if you use the project like so from lecture2notes.end_to_end.summarizer_class import LectureSummarizer?

Specifically for running the main.py script, you should run it as a module with python -m lecture2notes.end_to_end.main so that it can resolve the relative imports. Let me know if this helps!

from lecture2notes.

shashankmc avatar shashankmc commented on May 31, 2024

I had the same issue when I was trying to run the project on Colab. The relative import seems to be an issue for some reason even though I set the system path to lecture2notes directory.

I moved the models folder to end_to_end and replaced all relative imports in all files. Seems to work fine right after.

from lecture2notes.

chamodSamajith avatar chamodSamajith commented on May 31, 2024

from lecture2notes.

shashankmc avatar shashankmc commented on May 31, 2024

For running themain.py I did try that -

  1. Appended sys.path with lecture2notes directory
  2. Tried the same command as you mentioned.

No luck though, this is is the error --

Error while finding module specification for 'lecture2notes.end_to_end.main' (ModuleNotFoundError: No module named 'lecture2notes')

For the import, error is -
ModuleNotFoundError: No module named 'lecture2notes'

Also, I'm seeing this issue only on Google Colab!

from lecture2notes.

HHousen avatar HHousen commented on May 31, 2024

After installing the requirements, running the following in Google Colab works for me:

!git clone https://github.com/HHousen/lecture2notes
%cd lecture2notes
!python -m lecture2notes.end_to_end.main --help

Depending on which directory you added to sys.path, you might need to import from lecture2notes.lecture2notes or run this command instead: python -m lecture2notes.lecture2notes.end_to_end.main. This is because the actual lecture2notes package is located inside the lecture2notes directory within the repo. When git clones the repo it creates a directory called lecture2notes, which can make it confusing to work with.

from lecture2notes.

shashankmc avatar shashankmc commented on May 31, 2024

You are right, it does work as expected. I'm not sure why it didn't earlier. Might have missed something. Thank you for taking time out and providing the clarification! :)

from lecture2notes.

HHousen avatar HHousen commented on May 31, 2024

You're welcome 😄!

from lecture2notes.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.