eaysu commited on
Commit
94e2407
1 Parent(s): 93f6210

punk_tab added

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -2,13 +2,10 @@ import gradio as gr
2
  from transformers import MarianMTModel, MarianTokenizer
3
  import torch
4
  import nltk
5
- import os
6
 
7
  # Download punkt for sentence tokenization
8
- nltk_data_path = "/tmp/nltk_data" # Use "./nltk_data" if you want persistence
9
- os.makedirs(nltk_data_path, exist_ok=True)
10
- nltk.download('punkt', download_dir=nltk_data_path)
11
- nltk.data.path.append(nltk_data_path)
12
 
13
  from nltk.tokenize import sent_tokenize
14
 
 
2
  from transformers import MarianMTModel, MarianTokenizer
3
  import torch
4
  import nltk
 
5
 
6
  # Download punkt for sentence tokenization
7
+ nltk.download('punkt')
8
+ nltk.download('punkt_tab')
 
 
9
 
10
  from nltk.tokenize import sent_tokenize
11