sundaram07 commited on
Commit
ff5ddfb
·
verified ·
1 Parent(s): b0fee1e

Update app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +12 -0
src/streamlit_app.py CHANGED
@@ -1,4 +1,16 @@
1
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  import streamlit as st
3
  import tensorflow as tf
4
  import numpy as np
 
1
 
2
+ import nltk
3
+ import os
4
+
5
+ # Set local download directory (inside Hugging Face's writable space)
6
+ nltk_data_dir = os.path.join(os.path.dirname(__file__), "nltk_data")
7
+
8
+ # Download punkt tokenizer to local path
9
+ nltk.download("punkt", download_dir=nltk_data_dir)
10
+
11
+ # Set the path for NLTK to find data
12
+ nltk.data.path.append(nltk_data_dir)
13
+
14
  import streamlit as st
15
  import tensorflow as tf
16
  import numpy as np