findEthics commited on
Commit
77068ee
·
1 Parent(s): 2d4c5b0

move nltk package download

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -13,6 +13,9 @@ import spacy
13
  from rake_nltk import Rake
14
  import nltk
15
 
 
 
 
16
  # Configure logging
17
  logging.basicConfig(level=logging.INFO)
18
  logger = logging.getLogger(__name__)
@@ -208,12 +211,6 @@ async def startup_event():
208
  load_classifier()
209
  load_ner_model()
210
 
211
- try:
212
- nltk.download('stopwords')
213
- nltk.download('punkt_tab')
214
- except Exception as e:
215
- logger.error(f"NLTK download error: {e}")
216
-
217
  @app.post("/chat", response_model=ChatResponse)
218
  async def chat_endpoint(request: ChatRequest):
219
  """Enhanced chat endpoint with dynamic model selection"""
 
13
  from rake_nltk import Rake
14
  import nltk
15
 
16
+ nltk.download('stopwords')
17
+ nltk.download('punkt_tab')
18
+
19
  # Configure logging
20
  logging.basicConfig(level=logging.INFO)
21
  logger = logging.getLogger(__name__)
 
211
  load_classifier()
212
  load_ner_model()
213
 
 
 
 
 
 
 
214
  @app.post("/chat", response_model=ChatResponse)
215
  async def chat_endpoint(request: ChatRequest):
216
  """Enhanced chat endpoint with dynamic model selection"""