-
Notifications
You must be signed in to change notification settings - Fork 24
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
Conversation
Adapt OpenAI-based RAG example to Ollama. Some minor code improvements carried back into the OpenAI example.
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
39eaab5
to
1baad92
Compare
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.
There was a problem hiding this 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.
Talked to Miriam, and we agreed to move the recommended changes into the future (and probably onto her plate). |
Adapt OpenAI-based RAG example to Ollama.
Some minor code improvements carried back into the OpenAI example.