Terry Zhang commited on
Commit
454268b
·
1 Parent(s): 296146e

move nltk download

Browse files
Files changed (2) hide show
  1. app.py +5 -0
  2. tasks/text.py +0 -5
app.py CHANGED
@@ -1,6 +1,11 @@
1
  from fastapi import FastAPI
2
  from dotenv import load_dotenv
3
  from tasks import text, image, audio
 
 
 
 
 
4
 
5
  # Load environment variables
6
  load_dotenv()
 
1
  from fastapi import FastAPI
2
  from dotenv import load_dotenv
3
  from tasks import text, image, audio
4
+ import nltk
5
+
6
+ # Download required NLTK resources
7
+ nltk.download('punkt_tab')
8
+ nltk.download('wordnet')
9
 
10
  # Load environment variables
11
  load_dotenv()
tasks/text.py CHANGED
@@ -5,11 +5,6 @@ from sklearn.metrics import accuracy_score
5
  import random
6
  from skops.io import load
7
  # Textpreprocessor defined in this scope
8
- import nltk
9
-
10
- # Download required NLTK resources
11
- nltk.download('punkt_tab')
12
- nltk.download('wordnet')
13
 
14
 
15
  from .utils.evaluation import TextEvaluationRequest
 
5
  import random
6
  from skops.io import load
7
  # Textpreprocessor defined in this scope
 
 
 
 
 
8
 
9
 
10
  from .utils.evaluation import TextEvaluationRequest