plzz
Browse files
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"):
|