[Share Experiences] 成功在Deepin使用Python/openAI创建ChatGPI3.5聊天机器人
Tofloor
poster avatar
l***u@gmail.com
deepin
2023-03-18 01:30
Author

菜鸟第一次,成功在Deepin使用Python/openAI创建属于自己的 ChatGPI3.5聊天机器人 - 完全免费

today 3.17.2023 Friday, I created my First AI chatbot using openAI under Deepin in 20 minutes, it works perfectly well, for both English and Chinese.

see below

I'm using deepin 20.8 with installed python 3.7, under terminal I installed below pip3, openAI, gradio:

$ python3 -m pip install -U pip

$ pip3 install openai

$ pip3 install gradio

(that takes me less than 10 minutes)

obtained my first API key by individual registration

installed notepad++ txteditor from deepin store,

created my first app.py (that takes me less than 2 minutes)

===template===

import openai
import gradio as gr

openai.api_key = "Your API key"

messages = [
{"role": "system", "content": "You are a helpful and kind AI Assistant."},
]

def chatbot(input):
if input:
messages.append({"role": "user", "content": input})
chat = openai.ChatCompletion.create(
model="gpt-3.5-turbo", messages=messages
)
reply = chat.choices[0].message.content
messages.append({"role": "assistant", "content": reply})
return reply

inputs = gr.inputs.Textbox(lines=7, label="Chat with AI")
outputs = gr.outputs.Textbox(label="Reply")

gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title="AI Chatbot",
description="Ask anything you want",
theme="compact").launch(share=True)

====end===

run it, python3 /............app.py, post to local test in browser, in different app, by both Chinese and English, works perfectly well. Thanks BeeBom.

Glad to announce that, my 1st person AI chat bot is alive by using Deepin, i created all in 30 minutes, all free, feel free to use it, will be alive in 72 hours every launch

Reply Favorite View the author
All Replies
l***u@gmail.com
deepin
2023-03-18 04:45
#1

errors occuredseveral times due to model maximum content reached to the limit 4097 token, not sure it's limitation of gradios or GPI key, will find out later. anyway the experiences are quite pleasant, by zero cost. Very nice learning jouney. Deepin is stable.

the new AI chat bot link see below, it's dynamic address. I do hope can find a way to get permanent address soon. Running on public URL

Reply View the author
青稚°
Moderator
2023-03-18 11:47
#2

like

Reply View the author
l***u@gmail.com
deepin
2023-03-21 06:25
#3
It has been deleted!
l***u@gmail.com
deepin
2023-03-21 06:42
#4
It has been deleted!
l***u@gmail.com
deepin
2023-03-21 06:44
#5

每72小时无限续航,我想把它变成恒久远, 菜鸟努力中

https://ce5ccd66d796b5dc98.gradio.live

Reply View the author
l***u@gmail.com
deepin
2023-03-23 05:58
#6
l***u@gmail.com

每72小时无限续航,我想把它变成恒久远, 菜鸟努力中

https://ce5ccd66d796b5dc98.gradio.live

haha 没想到 这么快就实现了 https://lewisrxliu-2.hf.space

Reply View the author
l***u@gmail.com
deepin
2023-03-24 01:26
#7
l***u@gmail.com

haha 没想到 这么快就实现了 https://lewisrxliu-2.hf.space

image.png

Reply View the author
l***u@gmail.com
deepin
2023-03-26 03:59
#8

https://chat.openai.com/chat is free and open for everyone, driven by up-to-date model, however I will continously learn how to improve personal AI bot, first thing I want to do is enabling gTTs

Reply View the author
l***u@gmail.com
deepin
2023-04-08 20:08
#9

从零开始学习的菜鸟,偷懒向GPT请教,效果还不错

image.png

Reply View the author
l***u@gmail.com
deepin
2023-04-14 07:08
#10

今天升级了并分解了任务,先搞中文语音识别。https://lewisrxliu-3-2.hf.space 可能出错机率还是很大。不妨碍我的开心。这个小功能被我这个无基础的小白,自学探索中,一步一步搞出来了。

原GPT3.5turbo文本输入输出 https://lewisrxliu-2.hf.space 可能会溢出,不过并不妨碍我的带错尝试,争取尽快进化到多媒体版,同步语音视频输入输出,那样的机器人才像个人

Reply View the author
y***1@163.com
deepin
2023-05-22 23:05
#11
It has been deleted!
p***5@gmail.com
deepin
2023-06-15 18:16
#12
It has been deleted!