shrestha-prabin commited on
Commit
cab2179
·
verified ·
1 Parent(s): dc01079

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +4 -4
src/streamlit_app.py CHANGED
@@ -7,13 +7,13 @@ import streamlit as st
7
  from nltk.tokenize import word_tokenize
8
  import os
9
 
10
- # Create a local nltk_data directory in your working directory
11
- nltk_data_dir = os.path.join(os.path.dirname(__file__), "nltk_data")
12
 
13
- # Ensure the path exists
14
  os.makedirs(nltk_data_dir, exist_ok=True)
15
 
16
- # Add this path to nltk's search path
17
  nltk.data.path.append(nltk_data_dir)
18
 
19
  # Download 'punkt' only if not already downloaded
 
7
  from nltk.tokenize import word_tokenize
8
  import os
9
 
10
+ # Use a writable temporary directory
11
+ nltk_data_dir = "/tmp/nltk_data"
12
 
13
+ # Create the directory if it doesn't exist
14
  os.makedirs(nltk_data_dir, exist_ok=True)
15
 
16
+ # Add it to NLTK's data path
17
  nltk.data.path.append(nltk_data_dir)
18
 
19
  # Download 'punkt' only if not already downloaded