> 自媒体 > (AI)人工智能 > 五分钟在你的电脑上本机部署一个类ChatGPT的聊天机器人
五分钟在你的电脑上本机部署一个类ChatGPT的聊天机器人
来源:自由的代码
2023-04-15 17:21:07
323
管理

这是一个有意思的开源的类ChatGPT聊天机器人

官方的介绍:

演示、数据和代码,在LLaMa的基础上用~80万个GPT-3.5-Turbo代数训练一个助理式的大型语言模型。

一 部署非常简单,在GitHub上找到代码仓库 nomic-ai/gpt4all

下载代码仓库下载训练好的数据,大概4个G左右,在我的电脑上科学下载很快,接近20M/S运行

下载数据文件很快

二 试用一下

1 让它写个代码

python example for download File

Here is an example using the `Requests` library, which can be used with both Python2.x or newer versions (Python >= 3):```import requests # import module to make HTTP GET/POST calls in Python 3 and later versions of Pythonurl = 'https://www.examplewebsite.com'response = requests.get(url)# get the response from a URL, which can be either an HTML page or any other type of file (e.g., image, PDF document etc.)file_path=os.path.join('Downloads', 'downloaded-{}.jpg'.format(datetime.now().strftime("%Y%m%d-%H:%M"))) # create a unique filename for the downloaded file based on its creation time and date (e.g., `20191231-15:47`)with open('{}.jpg'.format(file_path), 'wb') as fp:# write binary data to an output stream, which can be either a file or memory buffer depending on the use case (e.g., for large files)

看起来像模像样,可惜没有写完整,没有真正的保存.不过大致意思是对的.

2 换c#

csharp example for download file

Here is an example using C#, which you would need to install if your project requires it:```using System;//...public void DownloadFile(string url, string destinationPath){//create a new HttpWebRequest object and set its properties accordingly. You can also use the WebClient class for downloading files in .NET Framework 4 or later versions of C#.}```

这次更过份,只有一行注释..

3 最过分的是让用Rust写个例子,竟然 死循环了

rust example for download file

To use the `download` crate in Rust, we can first install it using Cargo by running this command:```cargo --version=1.0-pre3 rustc-example/src/main.rs --outdir=/tmp/```Then, to download a file from an HTTPS server and save the contents of that downloaded file in Rust, we can use the `download` crate as follows:```rustextern Crates::crates_io; // For downloading files using Cargo. use std::path::PathBuf;import "http";// Use HTTPS server to download file contents from URL, then save it in Rust's `std` crate as a byte vector:let url = format!("https://example-site/file.txt"); // Replace with your own URL! use std::io;fn main() {let mut file_path = PathBuf::new();if Cargo::get().with_context("http", |ctx| ctx, "https://example-site/file.txt") == Ok(()) && io::fs::metadata(&Cargo::get(), &mut file_path) { // Replace with your own URL! let mut contents = Vec::new();if Cargo::with_context("http", |ctx| ctx, "https://example-site/file.txt") == Ok(()) && io::fs::metadata(&Cargo::get(), &mut file_path) { // Replace with your own URL! contents = Vec::new();if Cargo::with_context("http", |ctx| ctx, "https://example-site/file.txt") == Ok(()) && io::fs::metadata(&Cargo::get(), &mut file_path) { // Replace with your own URL! contents = Vec::new();if Cargo::with_context("http", |ctx| ctx, "https://example-site/file.txt") == Ok(()) && io::fs::metadata(&Cargo::get(), &mut file_path) { // Replace with your own URL! contents = Vec::new();if Cargo::with_context("http", |ctx| ctx, "https://example-site/file.txt") == Ok(()) && io::fs::metadata(&Cargo::get(), &mut file_path) { // Replace with your own URL! contents = Vec::new();if Cargo::with_context("http", |ctx| ctx,

后面无限的在写 "if"语句,看来rust真的比别的语言复杂,搞的AI都死机了...

没有办法,只能强制中止

4 写小说,关于张三爱上李四的

Write me a story about Zhang San falling in love with Li Si

写出来的是英文的,翻译过来是这样的:

很久以前,有一个叫张三的年轻人,住在一个远离文明的岛上。他由祖父母抚养长大,每天大部分时间都在钓鱼或照料花园里疯长的作物。有一天,当他外出采集浆果准备晚餐时,偶然发现了李四,一个美丽的年轻女子也独自生活在附近的一个岛上。张三立即被她的美貌所吸引,但她似乎也同样对他感到好奇,在几天的时间里,当他们从岛屿的不同地方采集食物或水时,他们的足迹一次又一次地交汇在一起,开始了交谈。最后,李四承认对张三也有感觉,他们决定是时候更充分地探索对方的世界了,他们乘坐用藤蔓捆绑的竹竿制成的筏子穿越海洋,直到最后到达他们的目的地:一个没有规则或限制的岛屿,只有两个相爱的人。在那里,他们为自己建造了一间小屋,从此过上了幸福的生活......

5 深入再写篇小说,关于张三同时爱上李四和王五的

Write a novel about Zhang San who falls in love with both Li Si and Wang Wu

翻译过来后:

张三出生在一个远离文明的小岛上,由他的祖父母抚养长大。他的大部分时间都在钓鱼或照料他们花园里疯长的作物。有一天,当他外出采集浆果准备晚餐时,偶然发现李四和王五都独自生活在附近的不同岛屿上。张三立刻被他们迷住了,但他们也同样对他感到好奇。他们决定最好是更全面地探索对方的世界,因此他们一起乘坐用藤蔓捆绑的竹竿制成的筏子穿越海洋,直到最后到达他们的目的地:一个没有规则或限制的岛屿,只有两个相爱的人。在那个与世隔绝的天堂,张三和李四一起建造了自己的小屋,从此过上了幸福的生活...。

看起来和上面那篇非常像,值得差评的是这篇小说最后丢失了一个人...

6 写诗,给我写篇张三爱上李四的诗

Zhang San was deeply enamored by the beauty of his beloved,Li Si. Her soft skin and gentle demeanor captivated him like no other could have done. He longed to be near her always, but she kept herself distant from Zhang's advances for fear that he would see through them as a ruse; after all, Li was already engaged in another relationship with someone else who had captured her heart and soul beforehand. Yet despite this, the love between these two lovers could not be denied or suppressed any longer than it took to write about their passionate affair for posterity's sake!

翻译过来:

张三被他心爱的李四的美貌深深地迷住了。她柔软的皮肤和温柔的举止让他着迷,这是其他任何人都无法做到的。他渴望永远接近她,但她却对张三的追求保持距离,因为她担心张三会看穿她的诡计;毕竟,李四已经和另一个人发生了关系,而这个人已经提前抓住了她的心和灵魂。然而,尽管如此,这对恋人之间的爱情是无法否认或压制的,就像为后人写下他们的激情恋情一样!"!

三 关于GPU

默认是用CPU来运行的,当回答问题的时候我的主机 的CPU飙升到40%以上,GPU占用没动静.

官网有教程,介绍如何用GPU来运行,笔者未尝试.

0
点赞
赏礼
赏钱
0
收藏
免责声明:本文仅代表作者个人观点,与本站无关。其原创性以及文中陈述文字和内容未经本网证实,对本文以及其中全部或者 部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。 凡本网注明 “来源:XXX(非本站)”的作品,均转载自其它媒体,转载目的在于传递更多信息,并不代表本网赞同其观点和对 其真实性负责。 如因作品内容、版权和其它问题需要同本网联系的,请在一周内进行,以便我们及时处理。 QQ:617470285 邮箱:617470285@qq.com
关于作者
御赐铲屎官..(普通会员)
文章
357
关注
0
粉丝
0
点击领取今天的签到奖励!
签到排行

成员 网址收录40329 企业收录2981 印章生成186789 电子证书796 电子名片49 自媒体20815

@2022 All Rights Reserved 浙ICP备19035174号-7
0
0
分享
请选择要切换的马甲:

个人中心

每日签到

我的消息

内容搜索