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

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

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

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

Owner
yujun
Please show me your code.
yujun
Fastseq 基于ONNXRUNTIME的文本生成加速框架

Fastseq 基于ONNXRUNTIME的文本生成加速框架

Jun Gao 9 Nov 09, 2021
VampiresVsWerewolves - Our Implementation of a MiniMax algorithm with alpha beta pruning in the context of an in-class competition

VampiresVsWerewolves Our Implementation of a MiniMax algorithm with alpha beta pruning in the context of an in-class competition. Our Algorithm finish

Shawn 1 Jan 21, 2022
Weaviate demo with the text2vec-openai module

Weaviate demo with the text2vec-openai module This repository contains an example of how to use the Weaviate text2vec-openai module. When using this d

SeMI Technologies 11 Nov 11, 2022
String Gen + Word Checker

Creates random strings and checks if any of them are a real words. Mostly a waste of time ngl but it is cool to see it work and the fact that it can generate a real random word within10sec

1 Jan 06, 2022
IMDB film review sentiment classification based on BERT's supervised learning model.

IMDB film review sentiment classification based on BERT's supervised learning model. On the other hand, the model can be extended to other natural language multi-classification tasks.

Paris 1 Apr 17, 2022
HF's ML for Audio study group

Hugging Face Machine Learning for Audio Study Group Welcome to the ML for Audio Study Group. Through a series of presentations, paper reading and disc

Vaibhav Srivastav 110 Jan 01, 2023
Python code for ICLR 2022 spotlight paper EViT: Expediting Vision Transformers via Token Reorganizations

Expediting Vision Transformers via Token Reorganizations This repository contain

Youwei Liang 101 Dec 26, 2022
Code for Editing Factual Knowledge in Language Models

KnowledgeEditor Code for Editing Factual Knowledge in Language Models (https://arxiv.org/abs/2104.08164). @inproceedings{decao2021editing, title={Ed

Nicola De Cao 86 Nov 28, 2022
An open source framework for seq2seq models in PyTorch.

pytorch-seq2seq Documentation This is a framework for sequence-to-sequence (seq2seq) models implemented in PyTorch. The framework has modularized and

International Business Machines 1.4k Jan 02, 2023
NLP topic mdel LDA - Gathered from New York Times website

NLP topic mdel LDA - Gathered from New York Times website

1 Oct 14, 2021
Codes for processing meeting summarization datasets AMI and ICSI.

Meeting Summarization Dataset Meeting plays an essential part in our daily life, which allows us to share information and collaborate with others. Wit

xcfeng 39 Dec 14, 2022
End-to-end image captioning with EfficientNet-b3 + LSTM with Attention

Image captioning End-to-end image captioning with EfficientNet-b3 + LSTM with Attention Model is seq2seq model. In the encoder pretrained EfficientNet

2 Feb 10, 2022
Text editor on python tkinter to convert english text to other languages with the help of ployglot.

Transliterator Text Editor This is a simple transliteration program which is used to convert english word to phonetically matching word in another lan

Merin Rose Tom 1 Jan 16, 2022
使用pytorch+transformers复现了SimCSE论文中的有监督训练和无监督训练方法

SimCSE复现 项目描述 SimCSE是一种简单但是很巧妙的NLP对比学习方法,创新性地引入Dropout的方式,对样本添加噪声,从而达到对正样本增强的目的。 该框架的训练目的为:对于batch中的每个样本,拉近其与正样本之间的距离,拉远其与负样本之间的距离,使得模型能够在大规模无监督语料(也可以

58 Dec 20, 2022
⛵️The official PyTorch implementation for "BERT-of-Theseus: Compressing BERT by Progressive Module Replacing" (EMNLP 2020).

BERT-of-Theseus Code for paper "BERT-of-Theseus: Compressing BERT by Progressive Module Replacing". BERT-of-Theseus is a new compressed BERT by progre

Kevin Canwen Xu 284 Nov 25, 2022
hashily is a Python module that provides a variety of text decoding and encoding operations.

hashily is a python module that performs a variety of text decoding and encoding functions. It also various functions for encrypting and decrypting text using various ciphers.

DevMysT 5 Jul 17, 2022
This project uses unsupervised machine learning to identify correlations between daily inoculation rates in the USA and twitter sentiment in regards to COVID-19.

Twitter COVID-19 Sentiment Analysis Members: Christopher Bach | Khalid Hamid Fallous | Jay Hirpara | Jing Tang | Graham Thomas | David Wetherhold Pro

4 Oct 15, 2022
TextFlint is a multilingual robustness evaluation platform for natural language processing tasks,

TextFlint is a multilingual robustness evaluation platform for natural language processing tasks, which unifies general text transformation, task-specific transformation, adversarial attack, sub-popu

TextFlint 587 Dec 20, 2022
SummerTime - Text Summarization Toolkit for Non-experts

A library to help users choose appropriate summarization tools based on their specific tasks or needs. Includes models, evaluation metrics, and datasets.

Yale-LILY 213 Jan 04, 2023
Simple multilingual lemmatizer for Python, especially useful for speed and efficiency

Simplemma: a simple multilingual lemmatizer for Python Purpose Lemmatization is the process of grouping together the inflected forms of a word so they

Adrien Barbaresi 70 Dec 29, 2022