smitb2005 commited on
Commit
dc518fa
·
1 Parent(s): 1acd7b0
Files changed (1) hide show
  1. main.py +10 -0
main.py CHANGED
@@ -21,6 +21,16 @@ from fastapi import FastAPI
21
  from fastapi.middleware.cors import CORSMiddleware
22
  from fastapi.responses import JSONResponse
23
  from fastapi.concurrency import run_in_threadpool
 
 
 
 
 
 
 
 
 
 
24
 
25
  '''
26
  if not os.environ.get("GROQ_API_KEY"):
 
21
  from fastapi.middleware.cors import CORSMiddleware
22
  from fastapi.responses import JSONResponse
23
  from fastapi.concurrency import run_in_threadpool
24
+ import nltk, os
25
+
26
+ # Force nltk to use your bundled data
27
+ nltk.data.path.append(os.path.join(os.path.dirname(__file__), "nltk_data"))
28
+
29
+ # Disable downloading at runtime (since Hugging Face is read-only)
30
+ def no_download(*args, **kwargs):
31
+ return None
32
+
33
+ nltk.download = no_download
34
 
35
  '''
36
  if not os.environ.get("GROQ_API_KEY"):