schwgHao commited on
Commit
bb758c4
1 Parent(s): c248ddd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -5
README.md CHANGED
@@ -36,10 +36,9 @@ The Transformer-XL model was pre-trained on the Wudao Corpus (with 280G samples)
36
  ```
37
 
38
  ```python
39
- from fengshen.models.transfo_xl_paraphrase import (
40
- TransfoXLModel,
41
- TransfoXLTokenizer
42
- )
43
 
44
  model = TransfoXLModel.from_pretrained('IDEA-CCNL/Randeng-TransformerXL-1.1B-Paraphrasing-Chinese')
45
  tokenizer = TransfoXLTokenizer.from_pretrained('IDEA-CCNL/Randeng-TransformerXL-1.1B-Paraphrasing-Chinese',
@@ -52,7 +51,7 @@ tokenizer = TransfoXLTokenizer.from_pretrained('IDEA-CCNL/Randeng-TransformerXL-
52
  ```python
53
  from fengshen.models.transfo_xl_paraphrase import paraphrase_generatete
54
  input_text = "年轻教师选择农村学校,还是县城学校?"
55
- res = paraphrase_generate(model, tokenizer, input_text, device=1)
56
  print(res)
57
  #
58
  ```
 
36
  ```
37
 
38
  ```python
39
+ from fengshen.models.transfo_xl_paraphrase import TransfoXLModel
40
+ from transformers import T5Tokenizer as TransfoXLTokenizer
41
+
 
42
 
43
  model = TransfoXLModel.from_pretrained('IDEA-CCNL/Randeng-TransformerXL-1.1B-Paraphrasing-Chinese')
44
  tokenizer = TransfoXLTokenizer.from_pretrained('IDEA-CCNL/Randeng-TransformerXL-1.1B-Paraphrasing-Chinese',
 
51
  ```python
52
  from fengshen.models.transfo_xl_paraphrase import paraphrase_generatete
53
  input_text = "年轻教师选择农村学校,还是县城学校?"
54
+ res = paraphrase_generate(model, tokenizer, input_text, device=0)
55
  print(res)
56
  #
57
  ```