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
A library for Multilingual Unsupervised or Supervised word Embeddings

MUSE: Multilingual Unsupervised and Supervised Embeddings MUSE is a Python library for multilingual word embeddings, whose goal is to provide the comm

Facebook Research 3k Jan 06, 2023
Gathers machine learning and Tensorflow deep learning models for NLP problems, 1.13 < Tensorflow < 2.0

NLP-Models-Tensorflow, Gathers machine learning and tensorflow deep learning models for NLP problems, code simplify inside Jupyter Notebooks 100%. Tab

HUSEIN ZOLKEPLI 1.7k Dec 30, 2022
Implemented shortest-circuit disambiguation, maximum probability disambiguation, HMM-based lexical annotation and BiLSTM+CRF-based named entity recognition

Implemented shortest-circuit disambiguation, maximum probability disambiguation, HMM-based lexical annotation and BiLSTM+CRF-based named entity recognition

0 Feb 13, 2022
Sentence Embeddings with BERT & XLNet

Sentence Transformers: Multilingual Sentence Embeddings using BERT / RoBERTa / XLM-RoBERTa & Co. with PyTorch This framework provides an easy method t

Ubiquitous Knowledge Processing Lab 9.1k Jan 02, 2023
pyupbit 라이브러리를 활용하여 upbit에서 비트코인을 자동매매하는 코드입니다. 조코딩 유튜브 채널에서 자세한 강의 영상을 보실 수 있습니다.

파이썬 비트코인 투자 자동화 강의 코드 by 유튜브 조코딩 채널 pyupbit 라이브러리를 활용하여 upbit 거래소에서 비트코인 자동매매를 하는 코드입니다. 파일 구성 test.py : 잔고 조회 (1강) backtest.py : 백테스팅 코드 (2강) bestK.p

조코딩 JoCoding 186 Dec 29, 2022
Mapping a variable-length sentence to a fixed-length vector using BERT model

Are you looking for X-as-service? Try the Cloud-Native Neural Search Framework for Any Kind of Data bert-as-service Using BERT model as a sentence enc

Han Xiao 11.1k Jan 01, 2023
Conditional Transformer Language Model for Controllable Generation

CTRL - A Conditional Transformer Language Model for Controllable Generation Authors: Nitish Shirish Keskar, Bryan McCann, Lav Varshney, Caiming Xiong,

Salesforce 1.7k Dec 28, 2022
The proliferation of disinformation across social media has led the application of deep learning techniques to detect fake news.

Fake News Detection Overview The proliferation of disinformation across social media has led the application of deep learning techniques to detect fak

Kushal Shingote 1 Feb 08, 2022
Sentiment Analysis Project using Count Vectorizer and TF-IDF Vectorizer

Sentiment Analysis Project This project contains two sentiment analysis programs for Hotel Reviews using a Hotel Reviews dataset from Datafiniti. The

Simran Farrukh 0 Mar 28, 2022
Must-read papers on improving efficiency for pre-trained language models.

Must-read papers on improving efficiency for pre-trained language models.

Tobias Lee 89 Jan 03, 2023
Code for CodeT5: a new code-aware pre-trained encoder-decoder model.

CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation This is the official PyTorch implementation

Salesforce 564 Jan 08, 2023
使用Mask LM预训练任务来预训练Bert模型。训练垂直领域语料的模型表征,提升下游任务的表现。

Pretrain_Bert_with_MaskLM Info 使用Mask LM预训练任务来预训练Bert模型。 基于pytorch框架,训练关于垂直领域语料的预训练语言模型,目的是提升下游任务的表现。 Pretraining Task Mask Language Model,简称Mask LM,即

Desmond Ng 24 Dec 10, 2022
Code for our paper "Transfer Learning for Sequence Generation: from Single-source to Multi-source" in ACL 2021.

TRICE: a task-agnostic transferring framework for multi-source sequence generation This is the source code of our work Transfer Learning for Sequence

THUNLP-MT 9 Jun 27, 2022
Fastseq 基于ONNXRUNTIME的文本生成加速框架

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

Jun Gao 9 Nov 09, 2021
Exploration of BERT-based models on twitter sentiment classifications

twitter-sentiment-analysis Explore the relationship between twitter sentiment of Tesla and its stock price/return. Explore the effect of different BER

Sammy Cui 2 Oct 02, 2022
Nested Named Entity Recognition

Nested Named Entity Recognition Training Dataset: CBLUE: A Chinese Biomedical Language Understanding Evaluation Benchmark url: https://tianchi.aliyun.

8 Dec 25, 2022
Text Normalization(文本正则化)

Text Normalization(文本正则化) 任务描述:通过机器学习算法将英文文本的“手写”形式转换成“口语“形式,例如“6ft”转换成“six feet”等 实验结果 XGBoost + bag-of-words: 0.99159 XGBoost+Weights+rules:0.99002

Jason_Zhang 0 Feb 26, 2022
CJK computer science terms comparison / 中日韓電腦科學術語對照 / 日中韓のコンピュータ科学の用語対照 / 한·중·일 전산학 용어 대조

CJK computer science terms comparison This repository contains the source code of the website. You can see the website from the following link: Englis

Hong Minhee (洪 民憙) 88 Dec 23, 2022
Contains the code and data for our #ICSE2022 paper titled as "CodeFill: Multi-token Code Completion by Jointly Learning from Structure and Naming Sequences"

CodeFill This repository contains the code for our paper titled as "CodeFill: Multi-token Code Completion by Jointly Learning from Structure and Namin

Software Analytics Lab 11 Oct 31, 2022
Chinese segmentation library

What is loso? loso is a Chinese segmentation system written in Python. It was developed by Victor Lin ( Fang-Pen Lin 82 Jun 28, 2022