Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ollama-based RAG example #45

Merged
merged 5 commits into from
Jul 9, 2024
Merged

Add Ollama-based RAG example #45

merged 5 commits into from
Jul 9, 2024

Conversation

ccreutzi
Copy link
Member

Adapt OpenAI-based RAG example to Ollama.
Some minor code improvements carried back into the OpenAI example.

Adapt OpenAI-based RAG example to Ollama.
Some minor code improvements carried back into the OpenAI example.
@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.04%. Comparing base (f8acb3a) to head (6f79fa2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #45      +/-   ##
==========================================
- Coverage   97.11%   97.04%   -0.07%     
==========================================
  Files          38       39       +1     
  Lines        1246     1286      +40     
==========================================
+ Hits         1210     1248      +38     
- Misses         36       38       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This example runs into timeouts in GitHub CI. On my dev machine, it returns in a few seconds, but the GitHub VM obviously runs much slower.
Copy link
Collaborator

@MiriamScharnke MiriamScharnke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really good example! Clear story, great title, shows a useful workflow! I have some stylistic feedback, but I'm hitting "approve" anyway, because it's definitely reached the level of review I've been able to give the other examples!

Feedback:

  • Opening paragraph, when I open the example, I see "-> title "Generate Response" " - is this meant to be a link? If not, remove.
  • Consolidate requirements into a single paragraph: To run this example, you need Text Analytics Toolbox. You also need a valid API key etc.

Download and Preprocess Documents:

  • add opening sentence: "The document corpus used in this example contains reports that ". Download the data.
    (then add url=[etc] in the same code block as the next bit)

  • generally, use Name=Value instead of 'Name',Value syntax

  • Define the function to read the text -> Create a file datastore from the downloaded files.

  • if possible, use @extractFileText directly instead of setting up a separate function handle.

  • helper function preprocessDocuments -> preprocessDocuments function, defined at the end of this example.

  • put the line initializing the chatbot into the next section, or its own section - it doesn't really belong to the data preprocessing step.

Retrieve Relevant Documents:

  • link to TAT functions ref pages when possible, such as bm25Similarity
  • "Iterate over sorted document indices until word limit is reached" -> keep using full sentences! Also explain what the iteration is doing.

@ccreutzi
Copy link
Member Author

ccreutzi commented Jul 9, 2024

Talked to Miriam, and we agreed to move the recommended changes into the future (and probably onto her plate).

@ccreutzi ccreutzi merged commit 2f52726 into main Jul 9, 2024
1 check passed
@ccreutzi ccreutzi deleted the OllamaRAGExample branch July 9, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants