pszemraj commited on
Commit
1d62389
1 Parent(s): 8b86372

update example code

Browse files
Files changed (1) hide show
  1. README.md +4 -3
README.md CHANGED
@@ -46,8 +46,6 @@ model_tag = "postbot/distilgpt2-emailgen"
46
  generator = pipeline(
47
  'text-generation',
48
  model=model_tag,
49
- do_sample=False,
50
- early_stopping=True,
51
  )
52
 
53
  prompt = """
@@ -55,10 +53,13 @@ Hello,
55
 
56
  Following up on the bubblegum shipment."""
57
 
58
- generator(
59
  prompt,
60
  max_length=64,
 
 
61
  ) # generate
 
62
  ```
63
 
64
  - try it in a [Google Colab](https://colab.research.google.com/gist/pszemraj/91df57e0c2caf1d5273b78576ad2853e/postbot-distilgpt2-emailgen-demo.ipynb) notebook
 
46
  generator = pipeline(
47
  'text-generation',
48
  model=model_tag,
 
 
49
  )
50
 
51
  prompt = """
 
53
 
54
  Following up on the bubblegum shipment."""
55
 
56
+ result = generator(
57
  prompt,
58
  max_length=64,
59
+ do_sample=False,
60
+ early_stopping=True,
61
  ) # generate
62
+ print(result[0]['generated_text'])
63
  ```
64
 
65
  - try it in a [Google Colab](https://colab.research.google.com/gist/pszemraj/91df57e0c2caf1d5273b78576ad2853e/postbot-distilgpt2-emailgen-demo.ipynb) notebook