Code Monkey home page Code Monkey logo

ollama-rag's Introduction

PrivateGPT with phind-codellama

Note: this example is a slightly modified version of this example from ollama source code

Setup

Set up a virtual environment (optional):

python3 -m venv .venv
source .venv/bin/activate

Install the Python dependencies:

pip install -r requirements.txt

Pull the model you'd like to use:

ollama pull phind-codellama

Get the data that you want to use as source for your embeddings

Set the source directory as an external folder

export SOURCE_DIRECTORY='../project'

Or copy the files to this project

mkdir source_documents
rsync -av --delete --exclude '.*' --exclude 'node_modules/' ../YOUR_PROJECT source_documents

Ingesting files

python3 ingest.py

Output should look like this:

Creating new vectorstore
Loading documents from source_documents
Loading new documents: 100%|████████████████████| 86/86 [00:01<00:00, 49.19it/s]
Loaded 86 new documents from source_documents
Split into 400 chunks of text (max. 500 tokens each)
Creating embeddings. May take some minutes...
Ingestion complete! You can now run privateGPT.py to query your documents

Ask questions

python3 privateGPT.py

Enter a query: Refactor ExternalDocumentationLink to accept an icon property and display it after the anchor text, replacing the icon that is already there

> Answer:
You can refactor the `ExternalDocumentationLink` component by modifying its props and JSX. First, update the prop types to include a new `icon` prop which will accept a ReactNode. Then, place the `{icon}` after the anchor text inside the component's JSX. Here's an example of how you could refactor this component:

```jsx
import React from 'react';

interface ExternalDocumentationLinkProps {
  className?: string;
  href: string;
  label?: string;
  icon?: React.ReactNode; // add this line
}

...

Limitations

  • Currently .ts and .tsx are being loaded with TextLoader as I coulnd't find any specific loader for Typescript files
  • phind-codellama needs 32 GB of RAM to run
  • This doesn't include an agent configuration

ollama-rag's People

Contributors

leroybm avatar

Stargazers

Giuseppe M. Rizzo avatar

Watchers

 avatar

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.