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

updating RAG example to use IBM granite model #745

Merged
merged 5 commits into from
Oct 31, 2024

Conversation

sujee
Copy link
Contributor

@sujee sujee commented Oct 25, 2024

Why are these changes needed?

Updating RAG example to use IBM Granite 3.0 model

Related issue number (if any).

Signed-off-by: Sujee Maniyam <sujee@node51.com>
@shahrokhDaijavad
Copy link
Member

@sujee I am getting an error while running the ray version of the Notebook (rag_1A_dpk_process_ray.ipynb) about not finding pdf2parquet_transform_ray. I had no problem with the Python version of this notebook. Here is the error:

ModuleNotFoundError Traceback (most recent call last)
File :13

ModuleNotFoundError: No module named 'pdf2parquet_transform_ray'

@shahrokhDaijavad
Copy link
Member

@sujee One more thing: In rag_1D_query_replicate.ipynb file, in "Step-6: Initialize LLM", please add the choice of IBM Granite as one of the models in the comments (I know that you are picking the Granite model for the actual execution).

@sujee
Copy link
Contributor Author

sujee commented Oct 25, 2024

@sujee I am getting an error while running the ray version of the Notebook (rag_1A_dpk_process_ray.ipynb) about not finding pdf2parquet_transform_ray. I had no problem with the Python version of this notebook. Here is the error:

ModuleNotFoundError Traceback (most recent call last) File :13

ModuleNotFoundError: No module named 'pdf2parquet_transform_ray'

If you have created a custom kernel when you setup the python env, like this

python -m ipykernel install --user --name=data-prep-kit --display-name "dataprepkit"

Choose this kernel in jupyter when running this notebook. See if it fixes the error.

@shahrokhDaijavad
Copy link
Member

@sujee Thanks for the suggestion. I was using a conda env. So, I removed that env and created and activated a new env. That fixed the problem! In any case, since I have now tested successfully by going all the way through the rag_1D notebook by starting from either Python or Ray versions, I am ready to approve this, after you make the "one more thing" change above. Thanks.

Signed-off-by: Sujee Maniyam <sujee@node51.com>
Copy link
Member

@shahrokhDaijavad shahrokhDaijavad left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks, @sujee

@shahrokhDaijavad shahrokhDaijavad self-requested a review October 29, 2024 18:30
"| meta/meta-llama-3-70b-instruct | Meta | 70 B | $ 0.65 | $ 2.75 | |\n",
"\n",
"\n",
"(Prices are as of Oct 2024)\n",
"\n",
Copy link
Member

@shahrokhDaijavad shahrokhDaijavad Oct 29, 2024

Choose a reason for hiding this comment

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

@sujee Since the prices keep changing all the time, even though you have commented that these are Oct. 24 prices, please remove the two price columns from this table (and the comment about Oct. 2024). Thanks.

BTW, the Llama 8b price number for the Output in the table is wrong. It should have been 0.25 (as shown on the replicate.com) and not 0.05. Same as Granite 8b numbers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed model table @shahrokhDaijavad

Copy link
Member

@shahrokhDaijavad shahrokhDaijavad left a comment

Choose a reason for hiding this comment

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

Thanks for making the change, @sujee. I tested the whole set of notebooks through 1D again after the change.

Copy link
Collaborator

@touma-I touma-I left a comment

Choose a reason for hiding this comment

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

Please see if you want to act on comments and let me know.

@@ -303,7 +303,8 @@
" \"data_files_to_use\": ast.literal_eval(\"['.pdf']\"),\n",
" # orchestrator\n",
" \"runtime_worker_options\": ParamsUtils.convert_to_ast(worker_options),\n",
" \"runtime_num_workers\": MY_CONFIG.RAY_RUNTIME_WORKERS,\n",
" # \"runtime_num_workers\": MY_CONFIG.RAY_RUNTIME_WORKERS,\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this commented out. Please remove or go back to using MY._CONFIG.RAY_RuNTIME_WORKERS = 1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Setting MY._CONFIG.RAY_RUNTIME_WORKERS = 1 breaks some other transforms: ededupe and fuzzy-dedupe.
They seem to need at least 2 workers.

So I am setting workers = 1 only for PDF2PQ step (so we don't run into the race condition of cleaning out the downloaded models.

This is a temp fix until other worker issues are resolved.

"| ibm-granite/granite-3.0-8b-instruct | IBM | 8 B | IBM's newest Granite Model v3.0 (default) |\n",
"| ibm-granite/granite-3.0-2b-instruct | IBM | 2 B | IBM's newest Granite Model v3.0 |\n",
"| meta/meta-llama-3.1-405b-instruct | Meta | 405 B | Meta's flagship 405 billion parameter language model |\n",
"| meta/meta-llama-3-8b-instruct | Meta | 8 B | |\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing description for the last 2 rows

Copy link
Member

Choose a reason for hiding this comment

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

@sujee I think we can add these descriptions for the last 2 rows:

Meta's 8 billion parameter language model
Meta's 70 billion parameter language model

Signed-off-by: Sujee Maniyam <sujee@node51.com>
@touma-I touma-I merged commit aa013d2 into IBM:dev Oct 31, 2024
1 check passed
@sujee sujee deleted the rag-example6-granite branch November 5, 2024 06:37
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.

3 participants