Alex Tyshka commited on
Commit
ba02478
1 Parent(s): ec092f2

Fix NLTK download

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -3,9 +3,12 @@ import torch
3
  import numpy as np
4
  import gradio as gr
5
  from nltk import word_tokenize, sent_tokenize
 
6
  from scipy.stats import shapiro
7
  from transformers import GPT2LMHeadModel, GPT2TokenizerFast
8
 
 
 
9
  model = GPT2LMHeadModel.from_pretrained('gpt2-large')
10
  tokenizer: GPT2TokenizerFast = GPT2TokenizerFast.from_pretrained('gpt2-large')
11
 
 
3
  import numpy as np
4
  import gradio as gr
5
  from nltk import word_tokenize, sent_tokenize
6
+ import nltk
7
  from scipy.stats import shapiro
8
  from transformers import GPT2LMHeadModel, GPT2TokenizerFast
9
 
10
+ nltk.download('punkt')
11
+
12
  model = GPT2LMHeadModel.from_pretrained('gpt2-large')
13
  tokenizer: GPT2TokenizerFast = GPT2TokenizerFast.from_pretrained('gpt2-large')
14