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
Code for Discovering Topics in Long-tailed Corpora with Causal Intervention.

Code for Discovering Topics in Long-tailed Corpora with Causal Intervention ACL2021 Findings Usage 0. Prepare environment Requirements: python==3.6 te

Xiaobao Wu 8 Dec 16, 2022
Associated Repository for "Translation between Molecules and Natural Language"

MolT5: Translation between Molecules and Natural Language Associated repository for "Translation between Molecules and Natural Language". Table of Con

67 Dec 15, 2022
A simple tool to update bib entries with their official information (e.g., DBLP or the ACL anthology).

Rebiber: A tool for normalizing bibtex with official info. We often cite papers using their arXiv versions without noting that they are already PUBLIS

(Bill) Yuchen Lin 2k Jan 01, 2023
SentimentArcs: a large ensemble of dozens of sentiment analysis models to analyze emotion in text over time

SentimentArcs - Emotion in Text An end-to-end pipeline based on Jupyter notebooks to detect, extract, process and anlayze emotion over time in text. E

jon_chun 14 Dec 19, 2022
Weakly-supervised Text Classification Based on Keyword Graph

Weakly-supervised Text Classification Based on Keyword Graph How to run? Download data Our dataset follows previous works. For long texts, we follow C

Hello_World 20 Dec 29, 2022
Transformer related optimization, including BERT, GPT

This repository provides a script and recipe to run the highly optimized transformer-based encoder and decoder component, and it is tested and maintained by NVIDIA.

NVIDIA Corporation 1.7k Jan 04, 2023
2021海华AI挑战赛·中文阅读理解·技术组·第三名

文字是人类用以记录和表达的最基本工具,也是信息传播的重要媒介。透过文字与符号,我们可以追寻人类文明的起源,可以传播知识与经验,读懂文字是认识与了解的第一步。对于人工智能而言,它的核心问题之一就是认知,而认知的核心则是语义理解。

21 Dec 26, 2022
This repo stores the codes for topic modeling on palliative care journals.

This repo stores the codes for topic modeling on palliative care journals. Data Preparation You first need to download the journal papers. bash 1_down

3 Dec 20, 2022
Awesome-NLP-Research (ANLP)

Awesome-NLP-Research (ANLP)

Language, Information, and Learning at Yale 72 Dec 19, 2022
Official implementation of MLP Singer: Towards Rapid Parallel Korean Singing Voice Synthesis

MLP Singer Official implementation of MLP Singer: Towards Rapid Parallel Korean Singing Voice Synthesis. Audio samples are available on our demo page.

Neosapience 103 Dec 23, 2022
내부 작업용 django + vue(vuetify) boilerplate. 짠 하면 돌아감.

Pocket Galaxy 아주 간단한 개인용, 혹은 내부용 툴을 만들어야하는데 이왕이면 웹이 편하죠? 그럴때를 위해 만들어둔 django와 vue(vuetify)로 이뤄진 boilerplate 입니다. 각 폴더에 있는 설명서대로 실행을 시키면 일단 당장 뭔가가 돌아갑니

Jamie J. Seol 16 Dec 03, 2021
A library that integrates huggingface transformers with the world of fastai, giving fastai devs everything they need to train, evaluate, and deploy transformer specific models.

blurr A library that integrates huggingface transformers with version 2 of the fastai framework Install You can now pip install blurr via pip install

ohmeow 253 Dec 31, 2022
Bot to connect a real Telegram user, simulating responses with OpenAI's davinci GPT-3 model.

AI-BOT Bot to connect a real Telegram user, simulating responses with OpenAI's davinci GPT-3 model.

Thempra 2 Dec 21, 2022
Anuvada: Interpretable Models for NLP using PyTorch

Anuvada: Interpretable Models for NLP using PyTorch So, you want to know why your classifier arrived at a particular decision or why your flashy new d

EDGE 102 Oct 01, 2022
An automated program that helps customers of Pizza Palour place their pizza orders

PIzza_Order_Assistant Introduction An automated program that helps customers of Pizza Palour place their pizza orders. The program uses voice commands

Tindi Sommers 1 Dec 26, 2021
Code for "Generative adversarial networks for reconstructing natural images from brain activity".

Reconstruct handwritten characters from brains using GANs Example code for the paper "Generative adversarial networks for reconstructing natural image

K. Seeliger 2 May 17, 2022
"Investigating the Limitations of Transformers with Simple Arithmetic Tasks", 2021

transformers-arithmetic This repository contains the code to reproduce the experiments from the paper: Nogueira, Jiang, Lin "Investigating the Limitat

Castorini 33 Nov 16, 2022
spaCy-wrap: For Wrapping fine-tuned transformers in spaCy pipelines

spaCy-wrap: For Wrapping fine-tuned transformers in spaCy pipelines spaCy-wrap is minimal library intended for wrapping fine-tuned transformers from t

Kenneth Enevoldsen 32 Dec 29, 2022
📜 GPT-2 Rhyming Limerick and Haiku models using data augmentation

Well-formed Limericks and Haikus with GPT2 📜 GPT-2 Rhyming Limerick and Haiku models using data augmentation In collaboration with Matthew Korahais &

Bardia Shahrestani 2 May 26, 2022
Perform sentiment analysis and keyword extraction on Craigslist listings

craiglist-helper synopsis Perform sentiment analysis and keyword extraction on Craigslist listings Background I love Craigslist. I've found most of my

Mark Musil 1 Nov 08, 2021