Skip to content

An LLM challenge to (i) fine-tune pre-trained HuggingFace transformer model to build a Code Generation language model, and (ii) build a retrieval-augmented generation (RAG) application using LangChain

Notifications You must be signed in to change notification settings

KwokHing/AI-Planet-LLM-Bootcamp-Challenge

Repository files navigation

AI Planet Large Language Model Bootcamp Challenge

A challenge from AI Planet's LLM bootcamp to (i) fine-tune pre-trained HuggingFace transformer model to build a Code Generation language model, and (ii) build a retrieval-augmented generation (RAG) application using LangChain


Part I: Fine-tuning Orca Mini 3B on evolved codealpaca dataset to build a Code Generation model

Fine-tuning Orca Mini 3B with the evolved codealpaca dataset equips Orca Mini the ability to perform better on code generation tasks.

When we asked Orca Mini to provide us codes for scikit-learn linear regression before fine-tuning was done, it requested for more information to be provided.

jpg

After fine-tuning, the model is able to return a more targeted code generation completion output shown below.

jpg


Part II: Building a Question & Answering Retrieval-Augmented Generation (RAG) application using LangChain

A simple RAG to answer questions on the Battle Line game rules (PDF) using LangChain. We used the INSTRUCTOR embeddings model (ranked highly on the Massive Text Embeddings Benchmark, MTEB leaderboard) for performing semantic retrieval and a quantized version of the impressive Mistral 7B for returning the completion output.

Examples of the RAG output:

jpg

jpg


Getting started

Open AI_Planet_LLM_Bootcamp_Challenge.ipynb on a jupyter notebook environment. Alternatively, you can view the codes in Open In Colab. The notebook consists of further technical details.


Bonus - Example on Fine-tuning Phi 1.5B using QloRA

Open AI_Planet_Bootcamp_Final_Assignment_Fine_tuning_Phi_1_5b.ipynb on a jupyter notebook environment. The notebook consists of further technical details.

About

An LLM challenge to (i) fine-tune pre-trained HuggingFace transformer model to build a Code Generation language model, and (ii) build a retrieval-augmented generation (RAG) application using LangChain

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published