“This is the fifth day of my participation in the First Challenge 2022. For details: First Challenge 2022.”

PaddleHub one-key couplet generation Tiger Dun welcome the Spring Festival

A, introducing

Couplets, one of the traditional Chinese cultures, also known as couplets or couplets, are antithetical statements written on paper, cloth, or carved on bamboo, wood or pillars. It is a unique art form of Chinese language with one word and one tone. Antithetical couplets are treasures of Chinese traditional culture.

1-1: Example of one-click couplet generation (based on ernie-gen- Couplet model implementation)

Couplet input:

'Shanghai tap water from the sea' 'people increase longevity years increase age ',' the wind blowing clouds disorderly day tears ', 'eyes without eyes ',' a city of flowers and rain mountain and River zhuang ', 'Dragon and Phoenix Chengxiang Fire tree silver attracted five countries to talk to her less leisurely full of grievances ',' get up early to eat early ', 'drink to the moonlight ', 'Spring breeze all the way to chase the dream of the country ',' night empty moon full is my lack or I ', 'Kunming Heilongtan two trees plum blossom poolCopy the code

Couplet output:

[' Shandong Larch flower falls in Dongshan ', 'Shandong Airport flies in Dongshan ',' Zhongshan Library hides the Mountain ', 'Shandong Larch leaves fall in Dongshan ',' Changchun flowers bloom in fresh spring long '] 'Spring is full of heaven and earth xi full home '] [' rain dozen flower stump sad ',' rain dozen flower stump frown ', 'rain dozen flower stump moving face ',' rain dozen frost bully moving face ', 'rain dozen flower stump aspersing worry '] [' tongue laborious tongue ',' verbal vow verbal ', 'verbal fight verbal ',' verbal fight verbal stop verbal ', 'The spring breeze is new ',' the spring breeze is new ', 'the spring breeze is new ',' the spring breeze is new ', 'the spring breeze is new ',' the spring breeze is new '] 'Shanchuan Yuxiu cheers and laughter to meet the four seas of one heart,' 'Shanchuan Yuxiu cheers and laughter to recruit guests of all nations,' 'Shanchuan Yuxiu cheers and laughter to welcome into the four seas bridge '] [' life is more bumpy have a cavity blood for me to work,' 'life is more bumpy have a cavity blood open to me,' 'life is more bumpy but a cavity blood open to me,' 'Life is more bumpy have a cavity of blood open to me ',' life is more bumpy have a cavity of worry to me '] [' Sir Sit down to worship Sir ', 'Lantern Festival night eat Lantern Festival ',' Lantern Festival night sit down to Lantern Festival ', 'Lantern Festival night music Lantern Festival ',' Lantern Festival night taste Lantern Festival '] [' wine ask qingtian ', 'pick up the pen to autumn wind ',' pick up the pen to plum blossom ', 'pen fu chou-heung', 'pen fu spring] [' hero draw the chickens kyushu future', 'the chickens nine days light of early dawn yew dies',' hero draw all the chickens kyushu, 'the chickens nine day light of early dawn yew Chinese', 'the chickens nine day light of early dawn haun humanities'] [' feeling comfortable and the wind and cloud volume of judah with the clouds', 'mood shu also earnestly cloud volume of judah with the clouds and the wind', 'love of long cloud volume ShuFu like clouds and wind', 'love to more people to go with the wind to the wind again', 'love of long cloud volume ShuFu with clouds and the wind'] [' scenery hangzhou four wind a half lake lotus', 4 'scenery hangzhou misty rain cloud half lake', 4 'hangzhou scenery scenery lake lotus', 'Hangzhou West Lake around the mountains half lake light ',' Hangzhou West Lake scenery half Lake lotus ']Copy the code

Second, before

2-1: Requirements for writing couplets

The length of the couplets varies, with only one or two words being short. It can be hundreds of words long. There are various forms of couplets, such as direct opposition, opposition, running opposition, couplet, and sentence matching. However, no matter what kind of couplets and what form they are used, they must have the following characteristics:

  1. The words should be equal and the sentences should be consistent. The number of words must be the same, no more, no less, except where a word is intentionally left out to achieve a certain effect.
  2. Level and oblique tone should be in harmony. The traditional custom is “oblique ups and downs”, that is, to use the end words of the upper sentences in oblique tones, and the end words of the lower sentences in horizontal tones.
  3. Be opposite and in the same place. Generally called “virtual to virtual, real to real”, it means noun to noun, verb to verb, adjective to adjective, quantifier to quantifier, adverb to adverb, and the opposite words must be in the same position.
  4. Make sure the content is relevant and connected. The meanings of the upstream and downstream must be connected, but not repeated.

In addition, the traditional way of hanging couplets is to write them straight and stick them vertically, from right to left, from top to bottom, not upside down. Hengpi, which is closely related to the couplet, can be said to be the title and center of the couplet. Good horizontal transcriptions can make the finishing touch and complement each other in couplets.

2-2: Introduction of open couplet data sets

The open couplet dataset used by the model is the Couplet-clean-dataset. This dataset is based on 70W datasets of The Couplet Dataset. On this basis, sensitive words are used to filter the data, and vulgar or sensitive content is deleted. After deletion, about 74W couplets are left. The original data set of more than 700,000 contains more vulgar or sensitive content, which is not suitable for commercial scenarios. For more specific information about the data set, go to the repO address of the data set to learn more about how to download the data, data filtering rules, and so on.

2-3: Introduction to the generation model of couplets

  1. Ernie_gen_couplet: ERNIE-GEN is a pre-training-fine-tuning framework for generation tasks. It is the first time that spAN-by-SPAN generation tasks are added in the pre-training stage, so that the model can generate one semantically complete fragment at a time. In pre-training and fine-tuning, the exposure bias problem is alleviated by filling generation mechanism and noise perception mechanism. In addition, ERNIE-GEN sampling multi-fragment – multi-granularity target text sampling strategy enhances the correlation between source text and target text, and enhances the interaction between encoder and decoder. Ernie_gen_couplet uses open source to fine-tune the syndication dataset and can be used to generate syndication. The following is the model structure:

ERNIE-GEN:An Enhanced Multi-flow Pre-training and Fine-Tuning Framework for Natural Language Generation

  1. Ernie_tiny_couplet: Ernie_tiny_couplet is a couplet generation model, which is fine-tuned by ernie_TINY pre-trained model via PaddleHub TextGenerationTask. It supports prediction only, For further fine-tuning, see PaddleHub Text_generation demo. See how fine-tune saved models can be converted to a PaddleHub Module for the conversion of pre-trained models to predictive modules. The following is the model structure:

Third, generate couplets

Note: Our model can be executed on CPU and GPU, but since AI Studio Advanced edition (GPU) is very difficult to get, we will show you how to run on CPU edition. To run on a GPU, switch to AI Studio GPU Advanced and set use_CUDa =True

3-1: Environment dependence

PaddlePaddle >= 1.8.0, PaddleHub >= 1.7.0; PaddleHub >= 1.7.0; PaddlePaddle >= 1.8.0; PaddleHub >= 1.7.0; PaddleHub >= 1.7.0 AI Studio has provided PaddlePaddle framework and PaddleHub pre-training model management tool for all developers, because we only need to meet the version, we can use the couplet generation model to complete one-click couplet generation. PaddleHub has two ways to implement couplet generation for developers, see 3-2 (command line one-click generation) and 3-3 (API call generation) for details.

Note: Since AI Studio installs PaddleHub 1.8.0 and 1.6.0 by default, we need to update PaddleHub to meet the environment dependency requirements of the couplet generation model; Below is the default initial version of AI Studio, where the PaddleHub version did not meet our environment requirements and needed to be updated

! pip install paddlehub --upgrade -i https://mirror.baidu.com/pypi/simple# (Upgrade paddleHub)
Copy the code
Looking in indexes: https://mirror.baidu.com/pypi/simple
Collecting paddlehub
[?25l  Downloading https://mirror.baidu.com/pypi/packages/1e/86/7184a1c76a3ca9bb47cbf838df6479164c21849da751452b5d11eea4140d/paddlehub-2.2.0-py3-none-any.whl (212kB)
[K     |████████████████████████████████| 215kB 16.9MB/s eta 0:00:01
[?25hRequirement already satisfied, skipping upgrade: packaging in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (21.3)
Requirement already satisfied, skipping upgrade: Pillow in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (7.1.2)
Requirement already satisfied, skipping upgrade: filelock in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (3.0.12)
Requirement already satisfied, skipping upgrade: pyyaml in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (5.1.2)
Requirement already satisfied, skipping upgrade: matplotlib in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (2.2.3)
Requirement already satisfied, skipping upgrade: flask>=1.1.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (1.1.1)
Requirement already satisfied, skipping upgrade: numpy in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (1.16.4)
Collecting paddle2onnx>=0.5.1 (from paddlehub)
[?25l  Downloading https://mirror.baidu.com/pypi/packages/db/72/69812b9f56028f6ce46cf4d11540d40d75474b3ac861fcbf439b92877add/paddle2onnx-0.9.0-py3-none-any.whl (84kB)
[K     |████████████████████████████████| 92kB 30.1MB/s eta 0:00:01
[?25hRequirement already satisfied, skipping upgrade: rarfile in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (3.1)
Requirement already satisfied, skipping upgrade: visualdl>=2.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (2.2.0)
Requirement already satisfied, skipping upgrade: pyzmq in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (22.3.0)
Requirement already satisfied, skipping upgrade: tqdm in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (4.27.0)
Requirement already satisfied, skipping upgrade: opencv-python in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (4.1.1.26)
Requirement already satisfied, skipping upgrade: paddlenlp>=2.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (2.1.1)
Requirement already satisfied, skipping upgrade: easydict in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (1.9)
Requirement already satisfied, skipping upgrade: colorama in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (0.4.4)
Requirement already satisfied, skipping upgrade: gunicorn>=19.10.0; sys_platform != "win32" in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (20.0.4)
Requirement already satisfied, skipping upgrade: colorlog in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlehub) (4.1.0)
Requirement already satisfied, skipping upgrade: pyparsing!=3.0.5,>=2.0.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from packaging->paddlehub) (3.0.6)
Requirement already satisfied, skipping upgrade: pytz in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from matplotlib->paddlehub) (2019.3)
Requirement already satisfied, skipping upgrade: six>=1.10 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from matplotlib->paddlehub) (1.16.0)
Requirement already satisfied, skipping upgrade: kiwisolver>=1.0.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from matplotlib->paddlehub) (1.1.0)
Requirement already satisfied, skipping upgrade: python-dateutil>=2.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from matplotlib->paddlehub) (2.8.2)
Requirement already satisfied, skipping upgrade: cycler>=0.10 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from matplotlib->paddlehub) (0.10.0)
Requirement already satisfied, skipping upgrade: click>=5.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flask>=1.1.0->paddlehub) (7.0)
Requirement already satisfied, skipping upgrade: Werkzeug>=0.15 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flask>=1.1.0->paddlehub) (0.16.0)
Requirement already satisfied, skipping upgrade: itsdangerous>=0.24 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flask>=1.1.0->paddlehub) (1.1.0)
Requirement already satisfied, skipping upgrade: Jinja2>=2.10.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flask>=1.1.0->paddlehub) (2.11.0)
Collecting onnx<=1.9.0 (from paddle2onnx>=0.5.1->paddlehub)
[?25l  Downloading https://mirror.baidu.com/pypi/packages/3f/9b/54c950d3256e27f970a83cd0504efb183a24312702deed0179453316dbd0/onnx-1.9.0-cp37-cp37m-manylinux2010_x86_64.whl (12.2MB)
[K     |████████████████████████████████| 12.2MB 9.3MB/s eta 0:00:011
[?25hRequirement already satisfied, skipping upgrade: protobuf in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddle2onnx>=0.5.1->paddlehub) (3.14.0)
Requirement already satisfied, skipping upgrade: bce-python-sdk in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->paddlehub) (0.8.53)
Requirement already satisfied, skipping upgrade: shellcheck-py in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->paddlehub) (0.7.1.1)
Requirement already satisfied, skipping upgrade: pre-commit in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->paddlehub) (1.21.0)
Requirement already satisfied, skipping upgrade: flake8>=3.7.9 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->paddlehub) (4.0.1)
Requirement already satisfied, skipping upgrade: pandas in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->paddlehub) (1.1.5)
Requirement already satisfied, skipping upgrade: Flask-Babel>=1.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->paddlehub) (1.0.0)
Requirement already satisfied, skipping upgrade: requests in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->paddlehub) (2.22.0)
Requirement already satisfied, skipping upgrade: paddlefsl==1.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlenlp>=2.0.0->paddlehub) (1.0.0)
Requirement already satisfied, skipping upgrade: jieba in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlenlp>=2.0.0->paddlehub) (0.42.1)
Requirement already satisfied, skipping upgrade: multiprocess in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlenlp>=2.0.0->paddlehub) (0.70.11.1)
Requirement already satisfied, skipping upgrade: seqeval in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlenlp>=2.0.0->paddlehub) (1.2.2)
Requirement already satisfied, skipping upgrade: h5py in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from paddlenlp>=2.0.0->paddlehub) (2.9.0)
Requirement already satisfied, skipping upgrade: setuptools>=3.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from gunicorn>=19.10.0; sys_platform != "win32"->paddlehub) (41.4.0)
Requirement already satisfied, skipping upgrade: MarkupSafe>=0.23 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from Jinja2>=2.10.1->flask>=1.1.0->paddlehub) (2.0.1)
Requirement already satisfied, skipping upgrade: typing-extensions>=3.6.2.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from onnx<=1.9.0->paddle2onnx>=0.5.1->paddlehub) (4.0.1)
Requirement already satisfied, skipping upgrade: future>=0.6.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from bce-python-sdk->visualdl>=2.0.0->paddlehub) (0.18.0)
Requirement already satisfied, skipping upgrade: pycryptodome>=3.8.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from bce-python-sdk->visualdl>=2.0.0->paddlehub) (3.9.9)
Requirement already satisfied, skipping upgrade: virtualenv>=15.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pre-commit->visualdl>=2.0.0->paddlehub) (16.7.9)
Requirement already satisfied, skipping upgrade: aspy.yaml in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pre-commit->visualdl>=2.0.0->paddlehub) (1.3.0)
Requirement already satisfied, skipping upgrade: importlib-metadata; python_version < "3.8" in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pre-commit->visualdl>=2.0.0->paddlehub) (4.10.0)
Requirement already satisfied, skipping upgrade: nodeenv>=0.11.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pre-commit->visualdl>=2.0.0->paddlehub) (1.3.4)
Requirement already satisfied, skipping upgrade: identify>=1.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pre-commit->visualdl>=2.0.0->paddlehub) (1.4.10)
Requirement already satisfied, skipping upgrade: toml in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pre-commit->visualdl>=2.0.0->paddlehub) (0.10.0)
Requirement already satisfied, skipping upgrade: cfgv>=2.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pre-commit->visualdl>=2.0.0->paddlehub) (2.0.1)
Requirement already satisfied, skipping upgrade: pyflakes<2.5.0,>=2.4.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flake8>=3.7.9->visualdl>=2.0.0->paddlehub) (2.4.0)
Requirement already satisfied, skipping upgrade: pycodestyle<2.9.0,>=2.8.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flake8>=3.7.9->visualdl>=2.0.0->paddlehub) (2.8.0)
Requirement already satisfied, skipping upgrade: mccabe<0.7.0,>=0.6.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flake8>=3.7.9->visualdl>=2.0.0->paddlehub) (0.6.1)
Requirement already satisfied, skipping upgrade: Babel>=2.3 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from Flask-Babel>=1.0.0->visualdl>=2.0.0->paddlehub) (2.8.0)
Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests->visualdl>=2.0.0->paddlehub) (3.0.4)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests->visualdl>=2.0.0->paddlehub) (2019.9.11)
Requirement already satisfied, skipping upgrade: idna<2.9,>=2.5 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests->visualdl>=2.0.0->paddlehub) (2.8)
Requirement already satisfied, skipping upgrade: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests->visualdl>=2.0.0->paddlehub) (1.25.6)
Requirement already satisfied, skipping upgrade: dill>=0.3.3 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from multiprocess->paddlenlp>=2.0.0->paddlehub) (0.3.3)
Requirement already satisfied, skipping upgrade: scikit-learn>=0.21.3 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from seqeval->paddlenlp>=2.0.0->paddlehub) (0.22.1)
Requirement already satisfied, skipping upgrade: zipp>=0.5 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from importlib-metadata; python_version < "3.8"->pre-commit->visualdl>=2.0.0->paddlehub) (3.6.0)
Requirement already satisfied, skipping upgrade: joblib>=0.11 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-learn>=0.21.3->seqeval->paddlenlp>=2.0.0->paddlehub) (0.14.1)
Requirement already satisfied, skipping upgrade: scipy>=0.17.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-learn>=0.21.3->seqeval->paddlenlp>=2.0.0->paddlehub) (1.3.0)
[31mERROR: onnx 1.9.0 has requirement numpy>=1.16.6, but you'll have numpy 1.16.4 which is incompatible.[0m
Installing collected packages: onnx, paddle2onnx, paddlehub
  Found existing installation: paddlehub 2.0.4
    Uninstalling paddlehub-2.0.4:
      Successfully uninstalled paddlehub-2.0.4
Successfully installed onnx-1.9.0 paddle2onnx-0.9.0 paddlehub-2.2.0
Copy the code

3-2:Command-line modeOne key to generate couplets

PaddleHub, at design time, provides command-line tools for model management and use, as well as a way to make predictions by calling the PaddleHub model from the command line. The following is the generation of couplets based on the hub run command. More paddlehub operation instructions

# command line one key couplet generation! hub run ernie_gen_couplet --input_textNew Year of the Tiger --use_gpu False --beam_width 10
Copy the code
/ opt/conda envs/python35 - paddle120 - env/lib/python3.7 / site - packages/setuptools/depends. Py: 2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp Download https://bj.bcebos.com/paddlehub/paddlehub_dev/ernie_gen_couplet.tar.gz [# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #] 100.00% Decompress /home/aistudio/.paddlehub/tmp/tmp3h62f0k8/ernie_gen_couplet.tar.gz [##################################################] 100.00% [32M [2022-01-22 21:33:21,149] [INFO][0M - Successfully installed Ernie_gen_couplet -1.1.0[0m [32m[2022-01-22 21:33:21.442][INFO][0M-downloading https://paddlenlp.bj.bcebos.com/models/transformers/ernie/ernie_v1_chn_base.pdparams and saved to / home/aistudio /. Paddlenlp/models/groeb - 1.0 100% [0 m | █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ | 392507/392507 [00:05 "00:00, 74002.56IT /s] [35m[2022-01-22 21:33:26,839] [DEBUG][0m-init ErnieModel with config: {'attention_probs_dropout_prob': 0.1, 'hidden_act': 'relu', 'hidden_dropout_PROb ': 0.1, 'hidden_size': 768,' initializER_range ': 0.02, 'MAX_POSItion_Embeddings ': 513,' NUM_attention_HEADS ': 12, 'NUM_hidden_layers ': 12,' type_VOCab_SIZE ': 2, 'vocab_size': 18000, 'pad_token_id': 0}[0m [32m[2022-01-22 21:33:30,590] [INFO][0m-loading Pretrained Model from / home/aistudio /. Paddlenlp/models/groeb - 1.0 / ernie_v1_chn_base pdparams [0 m [32 m [21:33:31 2022-01-22, 671] [INFO] [0 m - param:mlm_bias not set in pretrained model, Skip [0M [32m[2022-01-22 21:33:31.671][INFO][0M-param: MLM. Weight Not Set in pretrained Model, Skip [0M [32m[2022-01-22 21:33:31.671][INFO][0M-PARam: BIAS not Set in pretrained Model, Skip [0M [32m[2022-01-22 21:33:31.671][INFO][0M-param: MLm_ln. Weight Not Set in Pretrained model, Skip [0M [32m[2022-01-22 21:33:31.671][INFO][0M-param: MLM_ln. Bias Not Set in Pretrained model, Skip [0m [32m[2022-01-22 21:33:36,252] [INFO][0m - Downloading https://paddlenlp.bj.bcebos.com/models/transformers/ernie/vocab.txt and saved to / home/aistudio /. Paddlenlp/models/groeb - 1.0 [0 m [32 m [the 21:33:36 2022-01-22, 252] [INFO] [0 m - Downloading vocab. TXT the from https://paddlenlp.bj.bcebos.com/models/transformers/ernie/vocab.txt [0 m 100% | █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ | 90/90 [00:00:00 < 00:00:00, 21124.08 IT /s] [[' Huahuaworld View Lanterns ', 'Huahuaworld view Lanterns ',' Huahuaworld fall flowers ', 'every family reunion celebrate family Festival ',' Huahuaworld View lanterns ', 'Huahuaworld Explore flower Lang ', 'Huahua World falls peanuts ',' every family happy festival ', 'Huahua world bloom flowers '] [0mCopy the code

3-3:API methodsOne key to generate couplets

Through the prediction API, the up link is given and the program automatically generates the down link.

import paddlehub as hub

module = hub.Module(name="ernie_gen_couplet")

test_texts = [ "When the dragon rises, it grows purple."]
results = module.generate(texts=test_texts, use_gpu=False, beam_width=50)
for result in results:
    print(result)
Copy the code
/ opt/conda envs/python35 - paddle120 - env/lib/python3.7 / site - packages/matplotlib/set py: 107: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, And in 3.8 it will stop working from collections import MutableMapping / opt/conda envs/python35 - paddle120 - env/lib/python3.7 / site - packages/matplotlib/rcsetup. Py: 20: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, And in 3.8 it will stop working from collections import Iterable, Mapping/opt/conda envs/python35 - paddle120 - env/lib/python3.7 / site - packages/matplotlib/colors. The py: 53: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, And in 3.8 it will stop working from Collections import Sized Download https://bj.bcebos.com/paddlehub/paddlehub_dev/ernie_gen_couplet.tar.gz [# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #] 100.00% Decompress /home/aistudio/.paddlehub/tmp/tmpz3z6aez6/ernie_gen_couplet.tar.gz [##################################################] 100.00% [2022-01-22 22:08:13.694] [INFO] - Successfully installed ernie_gen_couplet-1.1.0 [2022-01-22 22:08:13.974] [INFO] - Successfully installed ernie_gen_couplet-1.1.0 [2022-01-22 22:08:13.974] INFO] - Downloading https://paddlenlp.bj.bcebos.com/models/transformers/ernie/ernie_v1_chn_base.pdparams and saved to / home/aistudio /. Paddlenlp/models/groeb - 1.0 100% | █ █ █ █ █ █ █ █ █ █ | 392507/392507 [00:10 "00:00, 36929.61 IT /s] [2022-01-22 22:08:24,680] [DEBUG] -init ErnieModel with config: {'attention_probs_dropout_prob': 0.1, 'hidden_act': 'relu', 'hidden_dropout_PROb ': 0.1, 'hidden_size': 768,' initializER_range ': 0.02, 'MAX_POSItion_Embeddings ': 513,' NUM_attention_HEADS ': 12, 'NUM_hidden_layers ': 12,' type_VOCab_SIZE ': 2, 'VOCAB_size ': 18000,' PAD_token_id ': 0} W0122 22:08:24.683709 101 Device_context. cc:447] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 10.1, Runtime API Version: 10.W0122 22:08:24.688863 101 Device_context. cc:465] Device :0, cuDNN Version: [2022-01-22 22:08:29.431] [INFO] - Loading Pretrained Model From / home/aistudio /. Paddlenlp/models/groeb - 1.0 / ernie_v1_chn_base pdparams [the 22:08:30 2022-01-22, 104] [INFO] - param: mlm_bias Not Set in pretrained Model, skip [2022-01-22 22:08:30,106] [INFO] - Param: Pretrained Model Skip [2022-01-22 22:08:30.00] [INFO] - PARam: Bias not Set in Pretrained Model Skip [2022-01-22 22:08:30,109] [INFO] - PARam: MLM_ln. Weight Not Set in Pretrained Model Skip [2022-01-22 22:08:30,111] [INFO] -BIAS: Bias not Set in Pretrained model The skip [the 22:08:33 2022-01-22, 631] [INFO] - Downloading https://paddlenlp.bj.bcebos.com/models/transformers/ernie/vocab.txt And saved to/home/aistudio /. Paddlenlp/models/groeb - 1.0 [the 22:08:33 2022-01-22, 634] [INFO] - Downloading vocab. TXT the from https://paddlenlp.bj.bcebos.com/models/transformers/ernie/vocab.txt | 100% █ █ █ █ █ █ █ █ █ █ | 90/90 [00:00 "00:00, The Spring Festival is celebrated by the warbler singing and yanwu, and the Spring Festival is celebrated by the warbler singing and yanwu. 'People and horses call zhao Bumper harvest ',' Shan Huan shui mu spring breeze ', 'spring spring ',' spring spring ', 'spring spring ',' spring spring news ', 'spring spring ',' spring spring ', 'shan Huan shui laugh spring tide ',' Shan Huan shui laugh spring tide ', 'Spring spring ',' Spring Festival ', 'Spring Festival ',' Spring Festival ', 'Spring Festival ',' Spring Festival ', 'Spring Festival ',' Spring Festival ', 'Spring Festival ',' Spring Festival ', 'Spring Festival ',' Spring Festival ', 'Spring Festival ',' Spring Festival ', 'Spring Festival ',' Spring Festival ', 'Spring Festival ',' Spring Festival ', 'Spring Festival ', 'Spring Festival ',' Spring Festival ', 'Spring Festival ',' Spring Festival ', 'Spring Festival ',' Spring Festival ', 'Spring Festival ',' Spring Festival ', 'Spring Festival ',' Spring Festival ', 'Spring Festival ',' Spring Festival ', 'Spring Festival ',' Spring Festival ' The Spring Festival is celebrated by the Spring Festival, and the Spring Festival is celebrated by the Spring Festival. The Spring Festival is celebrated by the Spring Festival. The Spring Festival is celebrated by the Spring Festival, and the Spring Festival is celebrated by the Spring Festival.Copy the code

parameter

  • Texts (list[STR]): texts in texts;
  • Use_gpu (bool): Indicates whether to use the GPU. If GPU is used, set the CUDA_VISIBLE_DEVICES environment variable first.
  • Beam_width: Beam search width, which determines the number of downlinks for each output.

return

  • Results (list[list][STR]): concatenation text, each concatenation produces beam_width concatenation.
%cd ~
test_texts = "When the dragon rises, it grows purple."
f=open('duilian.txt'.'w')
for result in results[0]:
    f.writelines(test_texts+","+result+ "。")
f.close()    
Copy the code
/home/aistudio
Copy the code
! cat duilian.txtCopy the code
Tigress dragon teng Ziqi, Spring Festival joy. When the dragon rises, the purple gas is born, and good weather brings good harvest. Tiger-leaping Dragon teng Ziqi, spring spring joy. Tigress dragon teng Ziqi, spring breeze singing orioles. Tigress dragon teng Ziqi, Spring Festival joy. Tigress dragon teng Ziqi, joy song Yan Wu Zhao bumper year. Tigress dragon teng Ziqi, warbler Song Yan Wu Song Hua nian. Tiexilongteng Ziqi, celebrate the New Year. Tigress dragon teng Ziqi, sing spring breeze warbler song Yan wu. When the tiger leaps, the horse is called a bumper harvest. Tiger Tielong Teng Ziqi, Mountain huan shui mu spring breeze smile. Tiaoyulongteng ziqi, spring breeze drunk yingyingyanwu. Tigress dragon teng ziqi, joy song yan wu spring breeze. Tigress dragon teng Ziqi, orioles reported good tidings. Tigress dragon teng Ziqi, spring breeze wei Song Yan wu. Tigress dragon teng Ziqi, Spring Festival Spring Festival. Tiger drums ZiQi, joy chung spring tides occur. Tiexilongteng ziqi, Mountain huanshui laugh Spring Festival. Tiexilongteng ziqi, Mountain huanshui smile chung spring tide. Tigress dragon teng Ziqi, spring breeze spring spring. Tigress dragon teng Ziqi, Spring Festival joy. Tiger leaping Dragon teng Ziqi, joy spring breeze song yanwu. Tigress dragon teng Ziqi, spring spring spring spring spring. Tigress dragon teng Ziqi, Spring Festival reported. Tiexilongteng Ziqi, the horse called the Spring Festival. Tiexilongteng ziqi, Mountain huan Shui laugh zhao bumper harvest. Tigress dragon tengsheng Ziqi, yingsong Yanwu ode Yangchun. The spring breeze is called out to the warbler. Tigress dragon teng Ziqi, warbler yanwu xiangyun. Tigress dragon teng Ziqi, spring breeze singing joy. Tiger leaping Dragon teng Ziqi, the horse called the spring breeze. Tigress dragon teng Ziqi, Spring Festival Spring Festival. Tiyuelong teng Ziqi, spring breeze to send spring. Tigress dragon teng Ziqi, warbler yanwu send auspicious. Tigress dragon teng Ziqi, joy joy joy. Tiexilongteng Ziqi, called qingfeng years. Tigress dragon teng Ziqi, spring sowing joy. Tiexiongteng Purple, flowers and birds to celebrate the New Year. Tiexilongteng ziqi, Mountain huanshui smile to congratulate the New Year. Tigress dragon teng Ziqi, Spring Festival, Spring Festival. Tiexilongteng ziqi, Mountain huanshui smile celebrate the New Year. Tigress dragon teng Ziqi, Spring Festival joy song Yan wu. Tigress dragon teng Ziqi, Spring Festival Spring Festival. Tigress dragon teng Ziqi, Spring Festival spring. Tiyuelong Teng Ziqi, yingyingyanwu Wing Spring light. Tigerleaping Dragon teng Ziqi, cock crow dog bark spring. Tiyuelong Teng Ziqi, spring sowing joy. Tiger leaping Dragon teng Ziqi, Spring Festival singing joy. Tiger leaping Dragon teng Ziqi, spring breeze sowing warbler song yan wu. Tiger leaping Dragon teng Ziqi, mountain clear water xiu spring breeze.Copy the code

Four, Hu Dun to read

1. Rely on the installation

%cd ~ ! pip install --upgrade pip# download nltk_data! wget https://paddlespeech.bj.bcebos.com/Parakeet/tools/nltk_data.tar.gz ! tar zxvf nltk_data.tar.gz ! git clone https://gitee.com/livingbody/PaddleBoBo.git --depth=1! pip install ppgan paddlespeechCopy the code

2. The configuration

GANDRIVING: FOM_INPUT_IMAGE: './file/input/test.png' # FOM_OUTPUT_VIDEO: './file/input/zimeng.mp4' SAVEPATH: VIDEO_SAVE_PATH: './file/output/video/' './file/output/audio/' # Save the path to generate virtual anchor videoCopy the code

3. Activate your static face

%cd ~/PaddleBoBo/ ! python create_virtual_human.py --config default.yamlCopy the code
/home/aistudio/PaddleBoBo
[01/22 23:19:13] ppgan INFO: Found /home/aistudio/.cache/ppgan/GPEN-512.pdparams
W0122 23:19:15.999140  7236 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 10.1, Runtime API Version: 10.1
W0122 23:19:16.003765  7236 device_context.cc:465] device: 0, cuDNN Version: 7.6.
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/tensor/creation.py:130: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. 
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  if data.dtype == np.object:
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_0. generator.noises.noise_0 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_1. generator.noises.noise_1 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_2. generator.noises.noise_2 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_3. generator.noises.noise_3 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_4. generator.noises.noise_4 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_5. generator.noises.noise_5 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_6. generator.noises.noise_6 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_7. generator.noises.noise_7 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_8. generator.noises.noise_8 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_9. generator.noises.noise_9 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_10. generator.noises.noise_10 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_11. generator.noises.noise_11 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_12. generator.noises.noise_12 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_13. generator.noises.noise_13 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_14. generator.noises.noise_14 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
[01/22 23:19:18] ppgan INFO: Found /home/aistudio/.cache/ppgan/vox-cpk-512.pdparams
[01/22 23:19:19] ppgan INFO: Found /home/aistudio/.cache/ppgan/GPEN-512.pdparams
1 persons have been detected
  0%|                                                   | 0/300 [00:00<?, ?it/s]/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/framework.py:744: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  elif dtype == np.bool:
100%|█████████████████████████████████████████| 300/300 [00:40<00:00,  7.32it/s]
IMAGEIO FFMPEG_WRITER WARNING: input image is not divisible by macro_block_size=16, resizing from (518, 534) to (528, 544) to ensure video compatibility with most codecs and players. To prevent resizing, make your input image divisible by the macro_block_size or set the macro_block_size to 1 (risking incompatibility).
[swscaler @ 0x67d2180] Warning: data is not aligned! This can lead to a speed loss
已成功创建虚拟人,文件保存在./file/input/test.mp4
Copy the code

4. General version generation

The numpy version is too high…

! pip uninstall numpy -yCopy the code
Found existing installation: numpy 1.19.5
Uninstalling numpy-1.19.5:
  Successfully uninstalled numpy-1.19.5
Copy the code
! pip install numpy==1.20
Copy the code
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting numpy = = 1.20 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/3a/6c/322f6aa128179d0ea45a543a4e29a74da2317117109899cfd56d09bf3de0/numpy-1.20 . 0 - cp37 - cp37m - manylinux2010_x86_64. WHL (15.3 MB) | █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ | 15.3 MB 8.8 MB/s [? 25 hinstalling collected packages: numpy ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is The source of the following dependency conflicts. Parl 1.4.1 requires Pyzmq ==18.1.1, But you have PyZMQ 22.3.0 which is incompatible. Paddlefsl 1.0.0 requires Numpy ~=1.19.2, But you have numpy 1.20.0 which is incompatible. Paddle-parakeet 0.0.0 requires Praatio ~=4.1, But you have praatio 5.0.0 which is incompatible. Blackhole 1.0.1 requires numpy<=1.19.5, But you have numpy 1.20.0 which is incompatible. Blackhole 1.0.1 requires tabulate==0.8.3, But you have tabulate 0.8.9 which is incompatible. Successfully installed numpy-1.20.0Copy the code
! python general_demo.py \ --human ./file/input/test.mp4 \ --output output. Mp4 \ --text Spring Festival is celebrated. When the dragon rises, the purple gas is born, and good weather brings good harvest. Tiger-leaping Dragon teng Ziqi, spring spring joy. Tigress dragon teng Ziqi, spring breeze singing orioles. Tigress dragon teng Ziqi, Spring Festival joy. Tigress dragon teng Ziqi, joy song Yan Wu Zhao bumper year. Tigress dragon teng Ziqi, warbler Song Yan Wu Song Hua nian. Tiexilongteng Ziqi, celebrate the New Year. Tigress dragon teng Ziqi, sing spring breeze warbler song Yan wu. When the tiger leaps, the horse is called a bumper harvest. Tiger Tielong Teng Ziqi, Mountain huan shui mu spring breeze smile. Tiaoyulongteng ziqi, spring breeze drunk yingyingyanwu. Tigress dragon teng ziqi, joy song yan wu spring breeze. Tigress dragon teng Ziqi, orioles reported good tidings. Tigress dragon teng Ziqi, spring breeze wei Song Yan wu. Tigress dragon teng Ziqi, Spring Festival Spring Festival. Tiger drums ZiQi, joy chung spring tides occur. Tiexilongteng ziqi, Mountain huanshui laugh Spring Festival. Tiexilongteng ziqi, Mountain huanshui smile chung spring tide. Tigress dragon teng Ziqi, spring breeze spring spring. Tigress dragon teng Ziqi, Spring Festival joy. Tiger leaping Dragon teng Ziqi, joy spring breeze song yanwu. Tigress dragon teng Ziqi, spring spring spring spring spring. Tigress dragon teng Ziqi, Spring Festival reported. Tiexilongteng Ziqi, the horse called the Spring Festival. Tiexilongteng ziqi, Mountain huan Shui laugh zhao bumper harvest. Tigress dragon tengsheng Ziqi, yingsong Yanwu ode Yangchun. The spring breeze is called out to the warbler. Tigress dragon teng Ziqi, warbler yanwu xiangyun. Tigress dragon teng Ziqi, spring breeze singing joy. Tiger leaping Dragon teng Ziqi, the horse called the spring breeze. Tigress dragon teng Ziqi, Spring Festival Spring Festival. Tiyuelong teng Ziqi, spring breeze to send spring. Tigress dragon teng Ziqi, warbler yanwu send auspicious. Tigress dragon teng Ziqi, joy joy joy. Tiexilongteng Ziqi, called qingfeng years. Tigress dragon teng Ziqi, spring sowing joy. Tiexiongteng Purple, flowers and birds to celebrate the New Year. Tiexilongteng ziqi, Mountain huanshui smile to congratulate the New Year. Tigress dragon teng Ziqi, Spring Festival, Spring Festival. Tiexilongteng ziqi, Mountain huanshui smile celebrate the New Year. Tigress dragon teng Ziqi, Spring Festival joy song Yan wu. Tigress dragon teng Ziqi, Spring Festival Spring Festival. Tigress dragon teng Ziqi, Spring Festival spring. Tiyuelong Teng Ziqi, yingyingyanwu Wing Spring light. Tigerleaping Dragon teng Ziqi, cock crow dog bark spring. Tiyuelong Teng Ziqi, spring sowing joy. Tiger leaping Dragon teng Ziqi, Spring Festival singing joy. Tiger leaping Dragon teng Ziqi, spring breeze sowing warbler song yan wu. Tiger leaping Dragon teng Ziqi, mountain clear water xiu spring breeze.Copy the code
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/librosa/core/constantq.py:1059: DeprecationWarning: `np.complex` is a deprecated alias for the builtin `complex`. To silence this warning, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  dtype=np.complex,
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/nltk/decorators.py:68: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
  regargs, varargs, varkwargs, defaults, formatvalue=lambda value: ""
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/nltk/lm/counter.py:15: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Sequence, defaultdict
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/nltk/lm/vocabulary.py:13: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Counter, Iterable
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/__init__.py:107: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import MutableMapping
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/rcsetup.py:20: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Iterable, Mapping
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/colors.py:53: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Sized
[01/22 23:20:35] ppgan INFO: Found /home/aistudio/.cache/ppgan/GPEN-512.pdparams
W0122 23:20:37.036042  7503 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 10.1, Runtime API Version: 10.1
W0122 23:20:37.040797  7503 device_context.cc:465] device: 0, cuDNN Version: 7.6.
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/tensor/creation.py:130: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. 
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  if data.dtype == np.object:
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_0. generator.noises.noise_0 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_1. generator.noises.noise_1 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_2. generator.noises.noise_2 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_3. generator.noises.noise_3 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_4. generator.noises.noise_4 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_5. generator.noises.noise_5 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_6. generator.noises.noise_6 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_7. generator.noises.noise_7 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_8. generator.noises.noise_8 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_9. generator.noises.noise_9 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_10. generator.noises.noise_10 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_11. generator.noises.noise_11 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_12. generator.noises.noise_12 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_13. generator.noises.noise_13 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py:1436: UserWarning: Skip loading for generator.noises.noise_14. generator.noises.noise_14 is not found in the provided dict.
  warnings.warn(("Skip loading for {}. ".format(key) + str(err)))
[2022-01-22 23:20:39,764] [    INFO] - File /home/aistudio/.paddlespeech/models/fastspeech2_csmsc-zh/fastspeech2_nosil_baker_ckpt_0.4.zip md5 checking...
[2022-01-22 23:20:40,803] [    INFO] - File /home/aistudio/.paddlespeech/models/pwgan_csmsc-zh/pwg_baker_ckpt_0.4.zip md5 checking...
Copy the code
Copy the code