GithubHelp home page GithubHelp logo

ultanio / openai-davinci003-python-speech Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 0ut0flin3/talk2gpt

0.0 0.0 0.0 36 KB

A Python script to use OpenAI's text-davinci-003 model using your own voice instead of text, in any language

License: MIT License

Python 100.00%

openai-davinci003-python-speech's Introduction

openai-davinci003-python-speech

A Python script to use OpenAI's text-davinci-003 model using your own voice instead of text. --the following method works on Linux (tested on Ubuntu in this case), on Windows it won't work as the dependencies and external programs used change, the more experienced will be able to adapt the code to their needs, in any case a version for Windows will be added soon--

REQUIRMENTS & HOW-TO-USE (PLEASE READ FIRST!)

Start the app

REQUIRMENTS and HOW TO USE (READ PLEASE!)

-In order to use this script you need to :

-have your OpenAI's Api key inside the OPENAI_API_KEY environment variable

-install these Python modules: openai,SpeechRecognition,gTTS,PyAudio

-install mpg321 (a mp3 player for linux)

So, first of all, install all required packages\modules:

sudo apt install mpg321 python3-dev portaudio19-dev

pip install openai

pip install SpeechRecognition

pip install gTTS

pip install PyAudio

If you have some mistakes in installing PyAudio read this topic: https://stackoverflow.com/questions/20023131/cannot-install-pyaudio-gcc-error

You should now be able to use the app with python3 app.py 2>/dev/null but FIRST take a look at the 2 JSON files that come with the script: speech_language.json and memories.json

speech_language.json :

contains the language that you want use to speak. You can change it, you can use any language.below the tickers for the languages

ar-SA Arabic Saudi Arabia
cs-CZ Czech Czech Republic
da-DK Danish Denmark
de-DE German Germany
el-GR Modern Greek Greece
en-AU English Australia
en-GB English United Kingdom
en-IE English Ireland
en-US English United States
en-ZA English South Africa
es-ES Spanish Spain
es-MX Spanish Mexico
fi-FI Finnish Finland
fr-CA French Canada
fr-FR French France
he-IL Hebrew Israel
hi-IN Hindi India
hu-HU Hungarian Hungary
id-ID Indonesian Indonesia
it-IT Italian Italy
ja-JP Japanese Japan
ko-KR Korean Republic of Korea
nl-BE Dutch Belgium
nl-NL Dutch Netherlands
no-NO Norwegian Norway
pl-PL Polish Poland
pt-BR Portuguese Brazil
pt-PT Portuguese Portugal
ro-RO Romanian Romania
ru-RU Russian Russian Federation
sk-SK Slovak Slovakia
sv-SE Swedish Sweden
th-TH Thai Thailand
tr-TR Turkish Turkey
zh-CN Chinese China
zh-HK Chinese Hong Kong
zh-TW Chinese Taiwan

memories.json :

Initially it is empty, every question and answer given with the AI is added to the file and every time the speeches are added to the prompt automatically so it will remember what you said. IF YOU WANT TO RESET THE MEMORY JUST OVERWRITE ALL THE CONTENT OF THE FILE WITH {} (so it must not be completely empty but contain {} otherwise it will cause an error)

START THE APP

Start the app with python3 app.py 2>/dev/null and say something...the AI will reply! If you say nothing, app could crash! SORRY FOR THAT, WILL FIX

openai-davinci003-python-speech's People

Contributors

0ut0flin3 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.