AEUPH commited on
Commit
6eef1ee
·
verified ·
1 Parent(s): 67a6e27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -9,7 +9,6 @@ from functools import lru_cache
9
  nltk.download('words')
10
  nltk.download('punkt') # Fix for missing tokenizer
11
  nltk.download('averaged_perceptron_tagger')
12
- nltk.download('tokenizers/punkt') # Fix missing punkt_tab issue
13
  from nltk.corpus import words
14
  from nltk.tokenize import sent_tokenize
15
  from nltk import pos_tag
@@ -53,6 +52,7 @@ class AscensionAI:
53
  try:
54
  with open("astral.txt", "r", encoding="utf-8") as file:
55
  text_data = file.read()
 
56
  sentences = sent_tokenize(text_data)
57
  return sentences[:1000] # Use first 1000 sentences for training
58
  except FileNotFoundError:
@@ -116,4 +116,4 @@ app = gr.Interface(
116
  )
117
 
118
  if __name__ == "__main__":
119
- app.launch()
 
9
  nltk.download('words')
10
  nltk.download('punkt') # Fix for missing tokenizer
11
  nltk.download('averaged_perceptron_tagger')
 
12
  from nltk.corpus import words
13
  from nltk.tokenize import sent_tokenize
14
  from nltk import pos_tag
 
52
  try:
53
  with open("astral.txt", "r", encoding="utf-8") as file:
54
  text_data = file.read()
55
+ nltk.download('punkt') # Ensure punkt tokenizer is available
56
  sentences = sent_tokenize(text_data)
57
  return sentences[:1000] # Use first 1000 sentences for training
58
  except FileNotFoundError:
 
116
  )
117
 
118
  if __name__ == "__main__":
119
+ app.launch()