rabie54654 commited on
Commit
2ea4eb5
·
1 Parent(s): 9b6c6af

Download NLTK data on startup

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -8,6 +8,15 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "Backend"))
8
  import spaces # REQUIRED for ZeroGPU
9
  import gradio as gr
10
  import uvicorn
 
 
 
 
 
 
 
 
 
11
  from Backend.api import app as fastapi_app
12
 
13
  # Create a minimal Gradio UI to satisfy ZeroGPU's requirements
 
8
  import spaces # REQUIRED for ZeroGPU
9
  import gradio as gr
10
  import uvicorn
11
+ import nltk
12
+
13
+ # Download required NLTK data before importing backend
14
+ nltk.download('punkt')
15
+ nltk.download('punkt_tab')
16
+ nltk.download('wordnet')
17
+ nltk.download('stopwords')
18
+ nltk.download('omw-1.4')
19
+
20
  from Backend.api import app as fastapi_app
21
 
22
  # Create a minimal Gradio UI to satisfy ZeroGPU's requirements