SecureLLMSys commited on
Commit
a7ed709
·
1 Parent(s): 48f2e3c
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -18,7 +18,11 @@ from src.prompts import wrap_prompt
18
  from gradio_highlightedtextbox import HighlightedTextbox
19
  from examples import run_example_1, run_example_2, run_example_3, run_example_4, run_example_5, run_example_6
20
  from functools import partial
21
- nltk.download('punkt')
 
 
 
 
22
 
23
  # Load original app constants
24
  APP_TITLE = '<div class="app-title"><span class="brand">AttnTrace: </span><span class="subtitle">Attention-based Context Traceback for Long-Context LLMs</span></div>'
 
18
  from gradio_highlightedtextbox import HighlightedTextbox
19
  from examples import run_example_1, run_example_2, run_example_3, run_example_4, run_example_5, run_example_6
20
  from functools import partial
21
+ os.makedirs("/home/user/nltk_data", exist_ok=True)
22
+ # Download punkt to a known path
23
+ nltk.download("punkt", download_dir="/home/user/nltk_data")
24
+ # Tell nltk where to find it
25
+ nltk.data.path.append("/home/user/nltk_data")
26
 
27
  # Load original app constants
28
  APP_TITLE = '<div class="app-title"><span class="brand">AttnTrace: </span><span class="subtitle">Attention-based Context Traceback for Long-Context LLMs</span></div>'