Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: zh
|
3 |
+
widget:
|
4 |
+
- text: 用户:写一首歌,歌手“毛毛”,歌曲“多少年后”,以“谎言,伤痛,心爱,掩饰,退一步,寻找”为主题。\n小L:
|
5 |
+
license: apache-2.0
|
6 |
+
pipeline_tag: text2text-generation
|
7 |
+
tags:
|
8 |
+
- music
|
9 |
+
- art
|
10 |
+
---
|
11 |
+
|
12 |
+
|
13 |
+
# Chinese T5
|
14 |
+
|
15 |
+
## Model description
|
16 |
+
|
17 |
+
Controllable lyrics creation generation model. Chinese lyrics can be generated based on the provided singer name, song name and several song theme keywords.
|
18 |
+
|
19 |
+
|
20 |
+
|
21 |
+
The lyric creation robot is called “小L”. So at the end of the input question, you need to add "\\n小L:"
|
22 |
+
|
23 |
+
## How to use
|
24 |
+
|
25 |
+
You can use this model directly with a pipeline for text2text generation:
|
26 |
+
|
27 |
+
```python
|
28 |
+
>>> from transformers import BertTokenizer, T5ForConditionalGeneration, Text2TextGenerationPipeline
|
29 |
+
>>> tokenizer = BertTokenizer.from_pretrained("uer/t5-small-chinese-cluecorpussmall")
|
30 |
+
>>> model = T5ForConditionalGeneration.from_pretrained("souljoy/t5-chinese-lyric")
|
31 |
+
>>> text2text_generator = Text2TextGenerationPipeline(model, tokenizer)
|
32 |
+
>>> text2text_generator("用户:写一首歌,歌手“毛毛”,歌曲“多少年后”,以“谎言,伤痛,心爱,掩饰,退一步,寻找”为主题。\\n小L:", max_length=512, do_sample=False)
|
33 |
+
```
|