ollama / ollama/ollama-python

Use with personal context

Open
#95 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.5k
Forks
1.2k
Avg merge
4m
Merged PRs (30d)
1

Description

Hello,
Trying to implement a way to question PDFs locally and get answers only based on data from the docs. I have already find a way to embed the data into a vector db (using Chroma) and then retrieve with a "similarity_search" the most relevant data from our query into the doc. I would like now to find a way to give to my model this context to generate answer on it, maybe by using a prompt into the generate call ?

query = "What is the date of the start of the battle ?"
    docs = db.similarity_search(query)
    print(docs[0].page_content)
    
    llm = Ollama(
        model=llm_model_name,
        callbacks=[StreamingStdOutCallbackHandler()],
    )
    my_retriever = db.as_retriever(search_kwargs={"k": 8})
    
    response = ollama.generate(
        "model": llm_model_name,
        
    )``` 
Thank you for your help !

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no repository files, tests, or entry points. Start by reviewing the Python library's documented generate usage and existing examples for passing retrieved context. Done would require a defined, supported way to provide Chroma-retrieved PDF context to the model and a documented expected result.

Written by the indexing model from the issue text.

Assessment

Tech stack
ollama, python
Domain
ai
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.