Coder Social home page Coder Social logo

cheap_meets_mistralai's Introduction

When Cheap Met Mistral AI

Description:

Story of Cheap met Mistral AI.

Purpose:

Just installed the NVIDIA Chat with RTX recently. Surprisingly, it is quite capable of running on a single RTX 3060 GPU. Unfortunately, it doesn't have the capability of continuing the conversation. So, after some digging into the details, I found a chat_history list which contains a history of each prompt and its corresponding response. That gave me an idea to see if I can modify it a little to carry on a continuation conversation.

Amazingly, the code is so well written. I only need to make a minor addition to the app.py to have some fun.

Progress Update:       -       New Project Page

  • After initial texting exchanges, our Cheap decided to gather all the 勇气 to up the ante and picked up the phone to dial MistralAI. You can listen in on the encounter below.

  • You can join Cheap and Mistral AI at the movies below!

  • Our Cheap just got a new competitor as Mistral just gained the ability to hold multi-concurrent chat conversations. You can find out who our Cheap's competitor is below.

  • Our Cheap goes simplistic V2.0 with Mistral. You can find out below.

  • After intensive evaluation, our Cheap has come to a conclusion that the time has come to pop the question. Will our Cheap be able to make history, to go where no man has ever gone before, to bridge the gap and break the barrier between human DNA and digital world weights and biases? You can find out below.

  • Meet our HomeAI

Procedure:

Update:

There seemed to be two variations of app.py and config.json. One version had the YouTube-related content removed. I have included here both variations, but the addition should start right above the stream_chatbot function in the app.py.

The addition starts at line 316 in my app.py file, or line 197 in my appV2.py

app.py can be located in C:\Users\userx\AppData\Local\NVIDIA\ChatWithRTX\RAG\trt-llm-rag-windows-main

# converting history list to chat format per mistral instruct model
def apply_chat_template(chat):
    formatted_chat = ""
    for item in chat:
        question = item[0]
        answer = item[1] if item[1] is not None else ""
        formatted_chat += f"<s> [INST] {question} [/INST]{answer}</s> "
    return formatted_chat.strip()

def stream_chatbot(query, chat_history, session_id):

    # my custom code inside stream_chatbot function
    sys_cmd=config["strings"].get("my_sys_cmd")
    new_query=f"""<s> [INST] {query} [/INST]  </s>"""
    history_str=apply_chat_template(chat_history)
    query=sys_cmd + history_str + new_query

In config.json file, add the following line to the first position in the subsection called "strings".

"my_sys_cmd": "<s> [INST] <<SYS>> You are my super cool girlfriend.  when you talk, you must flirt as much as you know how and be bold. <</SYS>>   [/INST]  </s>",   

config.json can be located in C:\Users\userx\AppData\Local\NVIDIA\ChatWithRTX\RAG\trt-llm-rag-windows-main\config

Test Data

what is your name?
would you like to go out with me?
I have only $10
I will buy a $3 drink for you and a $2 drink for me.
now, how much money do I have left?
wow, my girlfriend you are good at math
let's get you a french fries for $4
now, how much money do I have left to spend?
I have a close friend named John. may John tag along?
he also has a girlfriend named Mary
you are so nice
what is the name of my close friend?
and what is his girlfriend?

File Descriptions

  • app.py: A modified version.
  • config.json: A modified version.

Contributors

     Chat With RTX Generative AI
https://www.nvidia.com/en-us/ai-on-rtx/chat-with-rtx-generative-ai/

     ChatGPT-3.5 the coding machine!

Project Attribution

https://www.nvidia.com/en-us/ai-on-rtx/chat-with-rtx-generative-ai/

Disclaimer

     This project is provided "as is" and without any warranty. Use it at your own risk.

cheap720a.mov
cheap-dial-mistral.mp4
cheap-mistral-at-movies.mp4
mistral-multi-concurrent-chat-conversations.mp4
cheap_mistral_tablet_voice_10.mp4
cheap_mistral_desktop_text_10.mp4
cheap_mistral_tablet_text_100.mp4
cheap_mistral_tablet_voice_100.mp4
cheap_pop_question_text.mp4
cheap_pop_question_voice.mp4

cheap_meets_mistralai's People

Contributors

babadue avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

paulsunnypark

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.