Paddle2.x version AI-Writer

Overview

Paddle2.x 版本AI-Writer

用魔改 GPT 生成网文。Tuned GPT for novel generation. 原作者github地址:https://github.com/BlinkDL/AI-Writer

目录结构

|--AI-Writer.gif
|--AI-Writer.jpg
|--convert_pytorch2paddle.py # 转换pytorch权重代码
|--LICENSE
|--print_project_tree.py # 打印项目树状结构
|--README.md
|--run.py # 命令行运行
|--server.jpg
|--server.py # 开启服务
|--model
|      |--model_state.pdparams # 转换好的paddle权重文件
|      |--xuanhuan-2021-10-26.json
|      |--xuanhuan-2021-10-26.pth
|--paddle_src # 新版模型
|      |--model.py 
|      |--utils.py
|      |--__init__.py
|--paddle_src_slow # 旧版模型
|      |--convert_pytorch2paddle.py
|      |--model.py
|      |--utils.py
|      |--__init__.py
|--src # 原作者新版代码
|      |--model.py
|      |--utils.py
|      |--__init__.py
|--web-client # 前端页面
|      |--index.html
|      |--index.js

命令行使用方法:

  1. 进入原作者的 https://github.com/BlinkDL/AI-Writer ,下载模型,在右边 Release(或者看群文件),解压 pth 到 model 目录。
  2. python convert_pytorch2paddle.py 转换权重。
  3. 运行 python run.py
------------------------------------------------------------
  这是一颗急速旋转着的亮球!
  “呼!”
  就在这时,这颗亮球突然从林宇的手中飞了出来,在空中化成了一个小型的黄色的球状物。
  这是一颗乳白色的珠子,在现在的世界中,这样的球型物品无疑是非常罕见的,要知道林宇在世界之中也见识过很多。
  但是这样的球状物,却一直都是宝贝,可谓是难得一见,可以说是世界上最好的东西了。
  而且,在这颗球形的球形物里面,林宇甚至从中感觉到了一股仿佛随时都会倒下的强大压迫力,很明显,这就是天地
------------------------------------------------------------
  这是一颗很诡异的种子,同时也是一颗超级矿脉。
  杨昊到现在还不知道,那颗种子是怎样的恐怖,可能就连武帝和战帝都比不了。
  不过,杨昊倒是能够从那颗种子中感受到一种浓烈的生命之力,那种力量让他似乎都看到了一丝希望。
  不过,杨昊也知道自己恐怕很难活过去了,他身上可还有七十二颗种子呢。
  不过,事已至此,再想要活下去可就有点难了。
  杨昊将自身气息掩盖,悄然无息的潜伏在了杨昊的身后,以免他突然暴起伤人。
  就在杨昊暗自思
------------------------------------------------------------
  这是一颗强大的象征,是一个极其美丽的东西。
  而这颗象征着他智慧的树木,便是他最珍贵的东西了。
  第五百四十一章 见面
  当初,他是被林家选中的。
  有着如今的实力,更是在得到了林家的大力支持,以及大量的人气,而这些来自于其他地方的人,也都是纷纷在他的手中选出来了。
  至于对林家来说,这也是很好的事情。
  林家之中,其实已经有了很多的人才,甚至是能够成为更强大的人。
  但是,对于林家而言,却并不是很在意,这才是林家需要
------------------------------------------------------------

网页界面使用方法:

  1. 进入原作者的 https://github.com/BlinkDL/AI-Writer ,下载模型,在右边 Release(或者看群文件),解压 pth 到 model 目录。
  2. python convert_pytorch2paddle.py 转换权重。
  3. 运行 python server.py 开启服务。
  4. 打开 web-client/index.html,进行愉快的玩耍。

Reference

https://github.com/BlinkDL/AI-Writer


原作者的Readme

AI-Writer

用魔改 GPT 生成网文。Tuned GPT for novel generation. 现已支持 N卡 A卡 I卡 GPU 加速。

  1. 下载模型,在右边 Release(或者看 QQ 群文件),解压到 model 目录。欢迎分享下载后的模型。
  2. 运行 python run.py

也支持纯 CPU 快速生成,每秒生成 10 个字,下载请加 QQ 群 143626394(加入时请简单自我介绍)。

最新加入网页界面,执行 python server.py 然后打开 web-client 中的 index.html 即可。

Screenshot

注意:模型的训练数据全部来自网文,缺乏生活常识。生成的文字仅供娱乐。请遵守法律法规。

采用我的 RWKV 模型,比 GPT 更快,训练代码:https://github.com/BlinkDL/RWKV-LM

同时使用了特殊采样方法,改善小模型的生成质量(介绍见 https://zhuanlan.zhihu.com/p/394766831 )。

我的知乎是 https://www.zhihu.com/people/bopengbopeng

新玄幻模型效果:

Screenshot

旧模型效果:

Screenshot

魔皇突然倒退了一步,伸手摸了一下身上的伤口,然后朝着四周的虚空一指,原本在地下的虚空魔法阵直接消失无踪,这里顿时恢复了活性。 “来了……”魔皇喃喃的自语着,然后死死的盯着魔王的背影,不敢有丝毫的怠慢,在一个黑袍大汉的带领下,朝着人类的方向搜寻了过去。 几分钟之后,在前面的虚空魔法阵眼前一空,所有的人都露了出来,大家一个个的瞪大了眼睛。 “原来是魔皇大人。”听到魔皇的声音后,所有的人都感到惊讶,因为在他们眼中,这就是魔皇大人的魔导师,终于踏上了辉煌的魔法师之路,按理来说,能够拥有神力的魔导师是当之无愧的人类。 但是此刻魔皇的身影却消失在这片大海之中,似乎早就看穿了这一切,这让众人的心都悬了起来。 片刻之后,众人感觉到了空气中的清爽,所有人都猛的抬起头来,那巨大的眼睛里充满了向往,这样的表现让他们觉得此行不枉。 他们不由的弯下了嘴唇,暗自在心里偷笑,“还真是可怜这个少女,哪怕是族中最优秀的天才魔导

魔皇原本还想留下来帮助魔族重新实现宇宙皇庭,进入宇宙国之中,但是他们无法理解罗云阳的想法,纷纷开始接受宇宙国的鲜血,红颜的血液,在魔皇的支持之下,将一具完整的尸体交给了大罗龙族。 无一例外。 加上不知道如何改造的龙族族人,整个魔族,都是法则大打折扣的,大罗龙族之中,大多数族人,都是凡蜕境界的修炼者,并不是修炼的全部。 不过即便如此,所有人族也都是神通境界的强者,他们的血液,也是魔族的真血。 末世到来,整个魔族族人,都被献祭到了宇宙之中。 罗云阳和魔皇,曾经做过一些调查,想要杀害无辜的生命,但是无论他怎么做,没有丝毫的效果。 而在无数年前,同样的一些动手,让魔族损兵折将,没有对人族的敌人动手,也都是因为自己没有能够在魔界还保留在人族,而且在这个时候,魔界遭受重创的事情,却是一直没有发生。 因为他们也看出来,整个魔族,已经死于非命。 这些魔族,将在人族的战争之中,归属人族。 毕竟,人类发展到如今的

魔皇冲向洛寒,为什么没有动手,是因为洛寒身上释放出一种焚空气机,没有半点可以防御的地方。 他身上涌出恐怖的火焰,这股火焰团似乎是一个小火球,赤红色的火球让整个天空都是冒着一股可怕的黑气。 “明明是不受世界之力束缚的。” 魔皇双掌猛地一抱,以他的法力,在和洛寒的玄火火团对抗时,即便是伤了他,这点法力也没有放在眼里。 可洛寒就是这么不被世界之力束缚的火焰,身上燃烧着,死亡的恐怖气息似乎和天地能量结合在一起,魔皇手中一掌拍出,元神和本命精血之间产生出无尽的震动。 “死!” 魔皇周身同样结出魔灵附体,魔灵本源的修炼从高灵魔法转变为魔灵本源,正好对洛寒有克制力。 此刻身为天地之力合身,洛寒的火焰本源燃烧出了七个魔灵本源。 “阴阳生火术!” 洛寒灵识爆发,低喝一声,顿时手中双剑蕴含天地之力化作一个黑白色的龙形刀影,向洛寒的玉手迎去,三位魔皇分身见此,也紧随而上,全都在洛寒强大无比的灵识中施展各种神通,攻敌

You might also like...
This is the 25 + 1 year anniversary version of the 1995 Rachford-Rice contest
This is the 25 + 1 year anniversary version of the 1995 Rachford-Rice contest

Rachford-Rice Contest This is the 25 + 1 year anniversary version of the 1995 Rachford-Rice contest. Can you solve the Rachford-Rice problem for all t

Chinese Pre-Trained Language Models (CPM-LM) Version-I

CPM-Generate 为了促进中文自然语言处理研究的发展,本项目提供了 CPM-LM (2.6B) 模型的文本生成代码,可用于文本生成的本地测试,并以此为基础进一步研究零次学习/少次学习等场景。[项目首页] [模型下载] [技术报告] 若您想使用CPM-1进行推理,我们建议使用高效推理工具BMI

Simple GUI where you can enter an article and get a crisp summarized version.

Text-Summarization-using-TextRank-BART Simple GUI where you can enter an article and get a crisp summarized version. How to run: Clone the repo Instal

a test times augmentation toolkit based on paddle2.0.

Patta Image Test Time Augmentation with Paddle2.0! Input | # input batch of images / / /|\ \ \ # apply

Pure Python NetCDF file reader and writer

Pyncf Pure Python NetCDF file reading and writing. Introduction Inspired by the pyshp library, which provides simple pythonic and dependency free data

FireFlyer Record file format, writer and reader for DL training samples.

FFRecord The FFRecord format is a simple format for storing a sequence of binary records developed by HFAiLab, which supports random access and Linux

An easy FASTA object handler, reader, writer and translator for small to medium size projects without dependencies.

miniFASTA An easy FASTA object handler, reader, writer and translator for small to medium size projects without dependencies. Installation Using pip /

One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind them.

AwesomeVersion One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind

This Repository is an up-to-date version of Harvard nlp's Legacy code and a Refactoring of the jupyter notebook version as a shell script version.
This Repository is an up-to-date version of Harvard nlp's Legacy code and a Refactoring of the jupyter notebook version as a shell script version.

This Repository is an up-to-date version of Harvard nlp's Legacy code and a Refactoring of the jupyter notebook version as a shell script version.

A tool used to encrypt Python scripts version < 2.7 and version < 3.9
A tool used to encrypt Python scripts version 2.7 and version 3.9

A tool used to encrypt Python scripts version 2.7 and version 3.9

MCRPC (Minecraft Resource Pack Comparator) checks your resource pack against any version of Minecraft to show resources missing from your pack for that version.
MCRPC (Minecraft Resource Pack Comparator) checks your resource pack against any version of Minecraft to show resources missing from your pack for that version.

Minecraft Resource Pack Comparator MCRPC checks your resource pack against any version of Minecraft to show resources missing from your pack for that

A PaddlePaddle version of Neural Renderer, refer to its PyTorch version
A PaddlePaddle version of Neural Renderer, refer to its PyTorch version

Neural 3D Mesh Renderer in PadddlePaddle A PaddlePaddle version of Neural Renderer, refer to its PyTorch version Install Run: pip install neural-rende

Simple Python version management
Simple Python version management

Simple Python Version Management: pyenv pyenv lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UN

An improved version of the original AutoDD
An improved version of the original AutoDD

AutoDD = Automatically does the "due diligence" for you. If you want to know what stocks people are talking about on reddit, this little program might help you.

django-reversion is an extension to the Django web framework that provides version control for model instances.

django-reversion django-reversion is an extension to the Django web framework that provides version control for model instances. Requirements Python 3

:package: :fire: Python project management. Manage packages: convert between formats, lock, install, resolve, isolate, test, build graph, show outdated, audit. Manage venvs, build package, bump version.
:package: :fire: Python project management. Manage packages: convert between formats, lock, install, resolve, isolate, test, build graph, show outdated, audit. Manage venvs, build package, bump version.

THE PROJECT IS ARCHIVED Forks: https://github.com/orsinium/forks DepHell -- project management for Python. Why it is better than all other tools: Form

Python version of the Playwright testing and automation library.

🎭 Playwright for Python Docs | API Playwright is a Python library to automate Chromium, Firefox and WebKit browsers with a single API. Playwright del

Comments
  • 大神,训练代码修改哪些

    大神,训练代码修改哪些

    大神,如果在aistudio上运行,需要把原来的训练代码改成paddle的,自己尝试按照api映射表改了些函数,无法运行,有报错: import imp Traceback (most recent call last): File "train.py", line 11, in from src.model import GPT, GPTConfig File "/home/aistudio/train/RWKV-LM-2.00/src/model.py", line 60, in class RWKV_TimeMix(nn.layer): TypeError: module() takes at most 2 arguments (3 given) 请问大神你的训练代码修改了哪些?

    opened by maimaiya 2
Owner
yujun
Please show me your code.
yujun
FireFlyer Record file format, writer and reader for DL training samples.

FFRecord The FFRecord format is a simple format for storing a sequence of binary records developed by HFAiLab, which supports random access and Linux

null 77 Jan 4, 2023
Summarization, translation, sentiment-analysis, text-generation and more at blazing speed using a T5 version implemented in ONNX.

Summarization, translation, Q&A, text generation and more at blazing speed using a T5 version implemented in ONNX. This package is still in alpha stag

Abel 211 Dec 28, 2022
Summarization, translation, sentiment-analysis, text-generation and more at blazing speed using a T5 version implemented in ONNX.

Summarization, translation, Q&A, text generation and more at blazing speed using a T5 version implemented in ONNX. This package is still in alpha stag

Abel 137 Feb 1, 2021
Pytorch version of BERT-whitening

BERT-whitening This is the Pytorch implementation of "Whitening Sentence Representations for Better Semantics and Faster Retrieval". BERT-whitening is

Weijie Liu 255 Dec 27, 2022
GPT-Code-Clippy (GPT-CC) is an open source version of GitHub Copilot, a language model

GPT-Code-Clippy (GPT-CC) is an open source version of GitHub Copilot, a language model -- based on GPT-3, called GPT-Codex -- that is fine-tuned on publicly available code from GitHub.

Nathan Cooper 2.3k Jan 1, 2023
open-information-extraction-system, build open-knowledge-graph(SPO, subject-predicate-object) by pyltp(version==3.4.0)

中文开放信息抽取系统, open-information-extraction-system, build open-knowledge-graph(SPO, subject-predicate-object) by pyltp(version==3.4.0)

null 7 Nov 2, 2022
Pytorch-version BERT-flow: One can apply BERT-flow to any PLM within Pytorch framework.

Pytorch-version BERT-flow: One can apply BERT-flow to any PLM within Pytorch framework.

Ubiquitous Knowledge Processing Lab 59 Dec 1, 2022
An extension for asreview implements a version of the tf-idf feature extractor that saves the matrix and the vocabulary.

Extension - matrix and vocabulary extractor for TF-IDF and Doc2Vec An extension for ASReview that adds a tf-idf extractor that saves the matrix and th

ASReview 4 Jun 17, 2022
Refactored version of FastSpeech2

Refactored version of FastSpeech2. An implementation of Microsoft's "FastSpeech 2: Fast and High-Quality End-to-End Text to Speech"

ILJI CHOI 10 May 26, 2022
A simple version of DeTR

DeTR-Lite A simple version of DeTR Before you enjoy this DeTR-Lite The purpose of this project is to allow you to learn the basic knowledge of DeTR. P

Jianhua Yang 11 Jun 13, 2022