Package: compllments
compLLMentsDescriptionThis package enables you to send scheduled, uplifting, multi-modal AI-generated text messages to your friends. (Though they won't remain friends long if your only communicate is automated 😉)It works by first using an LLM to generate a batch of positive and complimentary messages in the language of your choice. Then, a multilingual sentiment classifier scores all the generated posts and selects the most positive to send either as an SMS or over WhatsApp. Further, after recording a few minutes of audio, a custom text-to-speech model will record the message in your voice.Hereis the accompanying Colab notebook.Table of ContentsInstallationUsageLicenseInstallationFirst, ensure thatpoetryis installed.poetry install
poe install-pytorchTo download files to store locally and save time of future downloads, run:download -m path/on/huggingfaceSMSFirst create a freeTwilioaccount and create a phone number (note: Twilio automatically prepends the messageSent from your Twilio trial accountto free-tier accounts). Copy your credentials from the dashboard into theTWILIO_CONFIGdictionary inconfig.py. An example config will look like:{
    "account_sid": "a_string",
    "auth_token": "a_token",
    "from_": "+11234567890",
}WhatsAppYou must log in from your computer for the messages to send.AudioTraining a custom test-to-speech (TTS) model requires a corpus of recordings to fine tine on. TheMozilla Common Voiceinitiative is a crowdsourced voice dataset. After creating an account, you can record yourself speaking sentences in the language of your choosing. Once finished recording, go toProfile>>Download My Dataand copy the URLs you see into theMOZILLA_CONFIGdictionary inconfig.pylike below:MOZILLA_CONFIG = {
    "first_url": "",
    "second_url": "",
}UsageTexts are sent by running:send -r recipient-name -s sender-name -n +11234567890 -l language -t type -b -sasend --helpexplains the parameter options. Pass your OpenAI API key using-oto use their models.You can send custom messages by chaning the text in theTEMPLATEobject inmain.pyYou can set custom model configuration in theINFERENCE_CONFIGobject inconifg.pyincluding swapping out models, increasing the output length by chaningmax_new_tokensor increasing the randomness in reponses by raisingtemperatureortop_p. The default language generation model isNousResearch/Nous-Hermes-13bwhich is thebest performing open-sourced LLMat the time of creation. The default sentiment analysis model iscardiffnlp/xlm-roberta-base-sentiment-multilingualwhich supports 8 languagees:arabic,english,french,german,hindi,italian,portuguese, and,spanish.To schedule texts to be sent at regular intervals, create a crontab similar to the example incron.ExamplesHere are some examples messages and their sentiment score.MessageSentiment ScoreHey Austin! Just wanted to remind you that you are an amazing friend and such a positive force in my life. Keep being you, because you're pretty darn great.0.939329206943512Hey Austin! Just wanted to let you know that you're an amazing friend and I'm lucky to have you in my life. Keep being your awesome self and never forget how much you're loved and appreciated! 😊0.9417279958724976Hey Austin! Just wanted to remind you that you are an amazing friend and person. Your kindness and positivity always brings a smile to my face. Keep being you, because you're awesome! :)0.946333646774292The final recording is below. This was generated by fine-tuning the text-to-speech model on 200 sentences. The more data it is given, the more life-like it will sound.TestsForthcoming...Releases0.1.0Self-hosted or OpenAI generated complimentsSMS and WhatsApp supportsSentiment-based message selectionMessage schedulingUser-friendly Colab notebook0.1.1FixedReadME.md0.2.0Custom voice messagesBirthday and custom message templatesLicenseMIT LicenseCopyright (c) [2023] [Austin Botelho]Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.