https://github.com/adithya-s-k/companionllm

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

https://github.com/adithya-s-k/companionllm

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (5.3%) to scientific vocabulary

Keywords

fine-tuning finetuning hacktoberfest hacktoberfest-accepted hacktoberfest2023 huggingface llama llama2 llamacpp llm llm-inference llm-training lora mit-license open-source peft
Last synced: 5 months ago · JSON representation

Repository

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

Basic Info
  • Host: GitHub
  • Owner: adithya-s-k
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 40.1 MB
Statistics
  • Stars: 42
  • Watchers: 1
  • Forks: 5
  • Open Issues: 4
  • Releases: 0
Topics
fine-tuning finetuning hacktoberfest hacktoberfest-accepted hacktoberfest2023 huggingface llama llama2 llamacpp llm llm-inference llm-training lora mit-license open-source peft
Created over 2 years ago · Last pushed about 2 years ago
Metadata Files
Readme Contributing License Code of conduct

README.md

CompanionLLM: Fine-tuning Different LLMs as Your Sentient Companion

Companion LLM

CompanionLLM [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/adithya-s-k/CompanionLLM/blob/main/CompanionLLM_Finetuning.ipynb)

Companion Mistral

CompanionMistral [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/adithya-s-k/CompanionLLM/blob/main/Mistral_7B_qLora_Finetuning.ipynb)

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

  • [x] Find a suitable pre-existing dataset - Using Samantha Dataset by Etartford
  • [x] Convert the dataset to a different LLM format
  • [x] Upload the dataset to Huggingface
  • [x] Add an option to set the companion name
  • [x] Fine-tune LLM using QLora PEFT
  • [x] Merge the PEFT and Test out inference
  • [x] Assign Companion name - Avalon(Artificial Virtual Assistant with Logical and Operational Navigation)
  • [x] Push Avalon Lora to Huggingface
  • [x] Get Inference from Avalon
  • [x] 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.

```

```

Owner

  • Name: Adithya S K
  • Login: adithya-s-k
  • Kind: user
  • Location: Indian
  • Company: Cognitivelab

Exploring Generative AI • Google DSC Lead'23 • Cloud & Full Stack Engineer • Drones & IoT • FOSS Contributor

GitHub Events

Total
  • Watch event: 5
Last Year
  • Watch event: 5

Committers

Last synced: 6 months ago

All Time
  • Total Commits: 52
  • Total Committers: 1
  • Avg Commits per committer: 52.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Adithya S K a****i@g****m 52

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 9
  • Total pull requests: 3
  • Average time to close issues: 6 days
  • Average time to close pull requests: less than a minute
  • Total issue authors: 2
  • Total pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • adithya-s-k (7)
Pull Request Authors
  • adithya-s-k (3)
Top Labels
Issue Labels
hacktoberfest (3) hacktoberfest-accepted (3)
Pull Request Labels
hacktoberfest (1) hacktoberfest-accepted (1)