sdsc-ordes / kg-llm-interface

Langchain-powered natural language interface to knowledge-graphs.
Apache License 2.0
12 stars 1 forks source link

Sparql query and local setup #14

Closed cmdoret closed 11 months ago

cmdoret commented 12 months ago

This PR mainly adds two things (along with a lot of refactoring):

local execution works by setting:

CHROMA_HOST='local'
SPARQL_ENDPOINT='/absolute/path.trig' 
# or './local/path'

It also adds a notebook documenting the whole process. It runs fully locally and can use the OpenAPI API.

Additional improvements:

caviri commented 12 months ago

In case it is useful I leave here how I'm running this using a jupyter lab instance.

  1. I modify the ENTRYPOINT at the bottom of Dockerfile by ENTRYPOINT ["/bin/bash"]
  2. Build the image: docker build kg-llm-interface .
  3. Run the image: docker run -it --rm -p 8888:8888 kg-llm-interface
  4. Install git: apt get install git
  5. Install aikg make install
  6. Install Jupyter lab: pip install jupyter lab
  7. Add poetry venv as ipykernel: poetry run python -m ipykernel install --user --name aikg
  8. Run the JLab session: jupyter lab --allow-root --port 8888 --ip '0.0.0.0'

I have been able to run the ng_sparql.ipynb without errors :)

P.S. Git is required to install aikg when running make install