ChatGPT was born as a variant of the GPT-3 linguistic model (Generative Pre-trained Transformer 3), developed by OpenAI . It was designed to generate text, as close to human as possible. Conversational-style, and usable for a variety of natural language processing tasks. For example chatbot, linguistic translation, and in all cases where the conversation can be considered as an answer to questions.
We can also install ChatGPT locally, and you can easily do this by installing the OpenAI API client, and setting up an API key. The OpenAI API client needs Python 3.7, and then you need to install it on your computer.
To install chatGPT locally follow these steps:
You can do this by running the following command (pip: Package Installer for Python):
pip installa openai
At this point, you need to register on the OpenAI website to get API access to OpenAI. It's simple and quick, you can do it directly on the site open AI by clicking here.
At the end of the registration, an API key will be displayed in the private area which you will need later in the code, you will have to replace it where you will find written YOUR_API_KEY
ChatGPT requires several python libraries to be installed, including requests, numpy, and tqdm
.
The command to install the libraries:
pip install requests numpy tqdm
At this point, you can use ChatGPT by importing it into your Python code, and to do that you must use the method openai.Completion.create()
. Here is an example:
import openai
# Set the API key
openai.api_key = “YOUR_API_KEY”
# Use the ChatGPT model to generate text
model_engine = “text-davinci-002”
prompt = “Hello, how are you today?”
completion = openai.Completion.create(engine=model_engine, prompt=prompt, max_tokens=1024, n=1,stop=None,temperature=0.7)
message = completion.choices[0].text
print(message)
If you want to install ChatGPT on a local system as an application:
winget
:# install the latest version
winget install - id=lencx.ChatGPT -e
# install the specified version
winget install - id=lencx.ChatGPT -e - version 0.10.0
Note: If the installation path and application name are the same, a conflict will occur ( #142 )
.app
brew tap lencx/chatgpt https://github.com/lencx/ChatGPT.git
brew install - cask chatgpt - no-quarantine
repo = "lencx/chatgpt" tap repo, "https://github.com/#{repo}.git" cask "chatgpt", args: { "no-quarantine": true }
.deb
, with small size, but with poor compatibility.deb
it doesn't startchatgpt-desktop-bin
and you can use your favorite AUR package manager to install it.chatgpt-desktop-git
.You might also like:
For any questions, feel free to contact me writing here
Ercole Palmeri
Predictive maintenance is revolutionizing the oil & gas sector, with an innovative and proactive approach to plant management.…
The UK CMA has issued a warning about Big Tech's behavior in the artificial intelligence market. There…
The "Green Houses" Decree, formulated by the European Union to enhance the energy efficiency of buildings, has concluded its legislative process with…
Casaleggio Associati's annual report on Ecommerce in Italy presented. Report entitled “AI-Commerce: the frontiers of Ecommerce with Artificial Intelligence”.…