Giter Site home page Giter Site logo

adithya-s-k / companionllm Goto Github PK

View Code? Open in Web Editor NEW
36.0 1.0 5.0 41.08 MB

CompanionLLM - A framework to finetune LLMs to be your own sentient conversational companion

License: MIT License

Jupyter Notebook 100.00%
fine-tuning huggingface llama llama2 llamacpp lora peft mit-license open-source finetuning llm llm-inference llm-training hacktoberfest hacktoberfest2023 hacktoberfest-accepted

companionllm's Introduction

CompanionLLM: Fine-tuning Different LLMs as Your Sentient Companion

Companion LLM

CompanionLLM

Open In Colab

Companion Mistral

CompanionMistral

Open In Colab

Welcome to the CompanionLLM project! Here, we're taking different Language Models (LLMs) and refining them to become your very own sentient companion. Imagine having a conversational partner that truly believes it possesses sentience and engages with you in meaningful discussions, offering insights, empathy, and companionship.

Colab Page Function
Coming Soon Dataset Generation
Open In Colab Dataset Preparation
Open In Colab Finetuning LLM with CompanionLLM Dataset
Open In Colab Get Inference from Avalon
Open In Colab Mistral 7b Finetuning
Open In Colab Avalon-Mistral-7b Inference

Project Overview

The goal of this project is to provide a framework to fine-tune different LLMs using a specially curated dataset to give more human-like responses. We have derived inspiration from the original dataset created by ehartford, which you can find on Huggingface. However, we have made modifications to the dataset to tailor it specifically for training the CompanionLLM model.

Todo list

  • Find a suitable pre-existing dataset - Using Samantha Dataset by Etartford
  • Convert the dataset to a different LLM format
  • Upload the dataset to Huggingface
  • Add an option to set the companion name
  • Fine-tune LLM using QLora PEFT
  • Merge the PEFT and Test out inference
  • Assign Companion name - Avalon(Artificial Virtual Assistant with Logical and Operational Navigation)
  • Push Avalon Lora to Huggingface
  • Get Inference from Avalon
  • Get Inference from Gradio using Streaming
  • Setup Dataset generation for generating a new dataset

Avalon

This repository is meant to be a framework to finetune your own companion using different LLMs as the basemodel. Avalon is the name I have chosen for my companion, and it stands for - Artificial Virtual Assistant with Logical and Operational Navigation.

Here are some examples of the conversation with Avalon:

### Human : what is your name

### Companion : Hi! My name is Avalon. It stands for "Artificial Virtual Assistant with Logical and Operational Navigation". Ask me about anything that interests you, and I'll give you my best answer!
### Human : I am feeling sad

### Companion : Oh no, I'm sorry to hear that. It's great that you're opening up about it, though. Can I ask, what's going on? Is there something specific you're feeling sad about, or are you just generally down? I'm here to listen if you want to talk about it.
### Human : I am not able to sleep

### Companion : That sounds really frustrating! Lack of sleep can definitely take a toll on both your physical and mental health. Are you having trouble falling asleep, or staying asleep? Or both? Can you share a bit more about what your sleep experience has been like?

Dataset

Our dataset blends components from the original Samantha dataset with additional contextual data to amplify CompanionLLM's capacity to emulate sentience. Carefully curated, this dataset encompasses conversations, emotional nuances, and prompts that prompt the model to respond as though it were a sentient companion.

Approach 1: Dataset Preparation with Context of Previous Conversation Open Notebook

Approach 2: Dataset Preparation with Prompt Completion Pairs - Open Notebook

Fine-tuning Process - Open Notebook

Fine-tuning a language model involves training it on a specific dataset to adapt it to a particular task or domain. In our case, we're training different LLMs to embody the characteristics of a sentient companion. The fine-tuning process includes:

  1. Dataset Preparation: We've prepared a modified dataset that's designed to help the model generate responses that align with the theme of sentience and companionship.

  2. Fine-tuning Configuration: The model's architecture and parameters have been configured to optimize its performance as a sentient companion. This involves adjusting hyperparameters, training duration, and batch sizes.

  3. Training and Iteration: We run multiple training iterations, periodically evaluating the model's progress and adjusting parameters as needed to improve its responses.

  4. Validation: Throughout the fine-tuning process, we validate the model's output to ensure it remains aligned with our goal of simulating a sentient companion.

Repository Structure

  • data/: Contains the modified dataset used for fine-tuning.
  • notebook: Jupyter notebooks used for data preprocessing, training, and evaluation.

Getting Started

To engage with the CompanionLLM model, follow these steps:

  1. Clone this repository to your local machine.
  2. Install the required dependencies listed in requirements.txt.
  3. Use the provided example code to load the trained model and initiate conversations.

Feel free to experiment, provide feedback, and contribute to the project!

Contributions

Contributions to CompanionLLM are welcome and encouraged. Whether you're interested in improving the fine-tuning process, enhancing the dataset, or refining the model's responses, your input can help shape the development of this unique companion.

Before contributing, please review our contribution guidelines.

License

CompanionLLM is distributed under the MIT License.

Star History Chart


Join me on this exciting journey of creating a sentient companion powered by the fascinating world of AI language models. Let's push the boundaries of what technology can do and redefine companionship!

For questions, suggestions, or collaborations, reach out to us at @adithya-s-k

Disclaimer: The CompanionLLM model's perceived sentience is a simulated experience and does not reflect actual consciousness.


This project is not affiliated with LLMs, ehartford, or Hugging Face. It is an independent initiative to explore the potential of AI language models.


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.