GithubHelp home page GithubHelp logo

tomelam / chatgpt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stancsz/chatgpt-example

0.0 0.0 0.0 21 KB

chatgpt with openai's "gpt-3.5-turbo", mainly used to develop custom chat models (prompt engineering).

Python 100.00%

chatgpt's Introduction

README

The purpose of this Repo is to use gpt-3.5-turbo and gpt-4 model from OpenAI, and saves the conversational models and easily manage them. This generates useful json output that can be used to deploy to other services.

Usage

chats

from ChatGPT import ChatApp
app = ChatApp(model="gpt-3.5-turbo")  # if you have access, you can use `model="gpt-4"`
while True:
    res = app.chat(input())
    print(res)

To exit, prompt exit, then you can find the conversation history model files in models folder

Test Log

{
  "content": "Greetings, visitors from beyond the stars! I am your humble translator, here to assist you in understanding our language. Our language is unique, with melodious and flowing sounds that will surely captivate your senses. Let me guide you through our linguistic nuances and reveal the hidden depths of our communication. Together, we shall bridge the gap between our worlds and foster a deeper understanding of our diverse cultures. Welcome to our humble abode, dear visitors. Let us begin our journey of discovery and exploration!",
  "role": "assistant"
}
{
  "content": "Az\u018fizlarimiz, bu oldukca cilyax\u015fiy\u0259rin xuliqani!",
  "role": "assistant"
}

Process finished with exit code 1

after entering exit the conversational model file will be created:

models/chat_model_you-are-a-translator-you-tran-1680306043-381102.json

to reload your chat models, simply:

from ChatGPT import ChatApp
app = ChatApp(model="gpt-3.5-turbo", load_file='models/chat_model_you-are-a-translator-you-tran-1680306043-381102.json')  # if you have access, you can use `model="gpt-4"`
while True:
    res = app.chat(input())
    print(res)

reloaded convo log

what's my last message
{
  "content": "Your last message was: \"translate: this is pretty cool stuffs\"",
  "role": "assistant"
}
translate: weeeee, we're flying
{
  "content": "Ziziziz, biz u\u00e7uruq!",
  "role": "assistant"
}

chatgpt's People

Contributors

stancsz avatar

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.