最近有个超级好玩的Github开源代码分享给大家,可以实现直接在本地电脑上运行GPT4,实现给机器人对话,获得想要的内容,亲测好用!废话不多说,直接上干货!
目录
一、Github项目地址
二、操作步骤
2.1 下载代码
2.2 操作方法
2.3 详细步骤
三、实现效果
3.1 问题一:中国最好的三所大学?
3.2 问题二:用python实现字符串逆排序
3.3 问题三:写一首赞美春天的诗句
四、是否可以实现中文对话
GitHub - nomic-ai/gpt4all: gpt4all: a chatbot trained on a massive collection of clean assistant data including code, stories and dialogue
实现效果:
如果大家本地可以顺畅使用Github,那么直接在上述Github链接进行下载代码即可,若如法实现,可以使用以下网盘链接:
链接:https://pan.baidu.com/s/1-Ksx-1s16z5guLKKNJ5Hgg
提取码:m8lx
以下是开始使用 CPU 量化 GPT4All 模型检查点的方法:
1. 下载文件 gpt4all-lora-quantized.bin
并放到chat文件夹下。
2. 运行适用于您的操作系统的相应命令:
系统版本 | 命令 |
---|---|
M1 Mac/OSX | cd chat;./gpt4all-lora-quantized-OSX-m1 |
Linux | cd chat;./gpt4all-lora-quantized-linux-x86 |
Windows(PowerShell) | cd chat;./gpt4all-lora-quantized-win64.exe |
英特尔 Mac/OSX | cd chat;./gpt4all-lora-quantized-OSX-intel |
以win10/11系统为例:搜索PowerShell,然后运行
the best university in china.
回答结果:
There are many universities in China but here is a list of three top-ranking institutions based on their performance and reputation for excellence: 1) Peking University, Beijing; 2) Tsinghua University, Bei
jing; 3) Shanghai JiaoTong University (Jiaotong), Shanghai.
翻译:
中国有很多大学,但根据它们的表现和卓越的声誉,这里列出了三所排名靠前的大学:1)北京大学,北京;2)清华大学,北京
京;3)上海交通大学,上海;
结果基本是正确的,hhh(复旦的友友当作看不见)。
Reverse a string in python.
回答结果:
In Python, you can reverse a string by using slicing and reversal operators on it like this -
```python
string = "Hello World" # replace with your desired input string
reversed_str = str(input)[:-len(input):] + str(input)[:-1].reverse() ## or just use reverse() method instead of slicing and reversal operators.
结果还是很不错的,代码运行起来也可以实现预期效果。
Help me write a poem praising spring, about 100 words.
回答结果:
Spring is the season of rebirth and renewal; it's when flowers bloom again after being dormant for months on end. The air smells sweet with freshness as you walk through fields filled with wildflowers in fu
ll blossoms, their colors vibrantly alive against a backdrop of blue skies or the greenest emerald hues that nature has to offer.
The birds are chirping and singing again; it's like they have been waiting for spring all along too! The sun shines brighter than ever before as you walk through fields filled with wildflowers in full bloss
oms, their colors vibrantly alive against a backdrop of blue skies or the greenest emerald hues that nature has to offer.
The air smells sweet and fresh again; it's like everything is renewed once more! The birds are chirping and singing again as you walk through fields filled with wildflowers in full blossoms, their colors vi
brantly alive against a backdrop of blue skies or the greenest emerald hues that nature has to offer.
The sun shines brighter than ever before; it's like everything is renewed once more! The birds are chirping and singing again as you walk through fields filled with wildflowers in full blossoms, their color
s vibrantly alive against a backdrop of blue skies or the greenest emerald hues that nature has to offer.
The air smells sweet; it's like everything is renewed once more! The birds are chirping and singing again as you walk through fields filled with wildflowers in full blossoms, their colors vibrantly alive ag
ainst a backdrop of blue skies or the greenest emerald hues that nature has to offer.
The sun shines brighter than ever before; it's like everything is renewed once more! The birds are chirping and singing again as you walk through fields filled with wildflowers in full blossoms, their color
s vibrantly alive against a backdrop of blue skies or the greenest emerald hues that nature has to offer.
The air smells sweet; it's like everything is renewed once more! The birds are chirping and singing again as you walk through fields filled with wildflowers in full blossoms, their colors vibrantly alive ag
ainst a backdrop of blue skies or the greenest emerald hues that nature has to offer.
The sun shines brighter than ever before; it's like everything is renewed once more! The birds are chirping and singing again as you walk through fields filled with wildflowers in full blossoms, their color
s
翻译结果:
春天是万物重生的季节;它是指花朵在休眠了几个月后重新开放。当你走在满是野花的田野里,空气闻起来清新而甜美。所有的花朵,它们的颜色在蓝天或大自然所提供的最绿的祖母绿的背景下充满活力。鸟儿又在啁啾歌唱了;就像它们一直在等待春天一样!当你走过开满野花的田野时,阳光比以往任何时候都更明媚。在蓝天或大自然提供的最绿的祖母绿的背景下,它们的颜色充满活力。空气再次散发出甜蜜和清新的气息;就好像一切都重新获得了新生!当你走过满是盛开的野花的田野时,鸟儿又在啁啾歌唱了。在蓝天或大自然所提供的最翠绿的色调的背景下,这座城市充满活力。空气闻起来很甜;就好像一切都重新获得了新生!当你走过满是盛开的野花的田野时,鸟儿又在啁啾和歌唱,它们的颜色充满活力。太阳比以往任何时候都更明亮;就好像一切都重新获得了新生!当你走过满是盛开的野花的田野时,鸟儿又在啁啾歌唱了年代。
结果还可以,hhh。
从机器人回答结果可知,目前这个项目暂不直接支持中文对话的,不过英文翻译过来结果也不错,后面有时间我会再出一篇关于部署中文版GPT的博文,跟大家一起体验。
友情提示:
如果大家无法正常使用上述方法,可以先订阅我的专栏“机器学习|深度学习|自然语言处理”,然后私信我,博主帮你解决,毕竟博主板砖也不易,希望大家理解,555。