Giter VIP home page Giter VIP logo

Comments (4)

sestinj avatar sestinj commented on June 18, 2024 1

@rpg2807 This is a limitation of running the server as a "frozen" binary. Any packages not included in the binary cannot be imported afterward, so you'll have to bundle it into the binary.

You did the right thing by adding it to requirements.txt, but sometimes pyinstaller misses a few imports when building the binary, which you'll have to list in the hidden_imports field in continue/run.spec. So you could try adding 'PyPDF2' to this list and then building again.

from continue.

sestinj avatar sestinj commented on June 18, 2024

@rpg2807 We have documentation here on how to add a context provider: https://continue.dev/docs/customization/context-providers#building-your-own-context-provider

Once you have a new context provider (the embeddings provider included), you can add it you your ~/.continue/config.py like this:

from continuedev.src.continuedev.plugins.context_providers.github import GitHubIssuesContextProvider

...
config=ContinueConfig(
  ...
  context_providers=[
    GitHubIssuesContextProvider(
      repo_name="continuedev/continue",  # change to whichever repo you want to use
      auth_token="<my_github_auth_token>",
    )
  ]
)

The embeddings context provider might work, so you could give it a try, but we will be working on it later this week and I can share when we have a production-ready version : )

from continue.

sestinj avatar sestinj commented on June 18, 2024

It might make sense (and be easier) to just add .pdf functionality to the URLContextProvider, just as basically an if statement if the URL is a .pdf, and then decode it to text in the specific way needed. Could just implement that in this function without needing to rewrite any of the context provider logic

from continue.

rpg2807 avatar rpg2807 commented on June 18, 2024

Thanks for the suggestion. That does look like an easier way around.
When I tried, I was having issues correctly installing/importing PyPDF2 module. I tried adding PyPDF2 in the requirements.txt, explicitly called 'pip install PyPDF2' in build.sh but nothing seems to be helping. When I load the extension, this is what I get:

File "/tmp/_MEI9a8UlQ/continuedev/src/continuedev/plugins/context_providers/url.py", line 7, in <module>
    from PyPDF4 import PdfFileReader

ModuleNotFoundError: No module named 'PyPDF2'

Could you please instruct how could one add a python module to be used in the context provider?

from continue.

Related Issues (20)

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.