ChatGPT 誕生於 GPT-3 語言模型(Generative Pre-trained Transformer 3)的變體,由 OpenAI . 它旨在生成盡可能接近人類的文本。 會話風格,可用於各種自然語言處理任務。 例如 聊天機器人,語言翻譯,以及所有可以將對話視為問題答案的情況。
我們也可以在本地安裝 ChatGPT,您可以通過安裝 OpenAI API 客戶端並設置 API 密鑰來輕鬆完成此操作。 OpenAI API 客戶端需要 蟒蛇 3.7,然後你需要在你的電腦上安裝它。
要在本地安裝 chatGPT,請執行以下步驟:
您可以通過運行以下命令(pip:Python 的包安裝程序):
pip installa openai
此時需要在OpenAI官網註冊,獲取OpenAI的API訪問權限。 簡單快捷,直接在網站上就可以做 單擊此處打開 AI.
在註冊結束時,一個 API 密鑰將顯示在您稍後在代碼中需要的私有區域中,您必須在您找到的地方替換它 YOUR_API_KEY
ChatGPT 需要安裝幾個 python 庫,包括 requests, numpy, and tqdm
.
安裝庫的命令:
pip install requests numpy tqdm
此時,您可以通過將 ChatGPT 導入到您的 Python 代碼中來使用它,為此您必須使用該方法 openai.Completion.create()
. 這是一個例子:
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)
如果您想將 ChatGPT 作為應用程序安裝在本地系統上:
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
注意:如果安裝路徑和應用名稱相同,會發生衝突( #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
,體積小,但兼容性差.deb
它沒有開始chatgpt-desktop-bin
你可以使用你最喜歡的 AUR 包管理器來安裝它。chatgpt-desktop-git
.您可能也會對以下內容感興趣:
如有任何問題,請隨時與我聯繫 寫在這裡
Ercole Palmeri
Casaleggio Associati 發布了義大利電子商務年度報告。題為「人工智慧商務:人工智慧電子商務的前沿」的報告...