Phoenix21 commited on
Commit
1cfc91b
·
1 Parent(s): eeb497b

handled punkt error1

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -18,7 +18,7 @@ import gradio as gr
18
  import pandas as pd
19
  import json
20
 
21
- # Download required nltk resources
22
  nltk.download('punkt')
23
 
24
  # Load spaCy English model
@@ -86,7 +86,7 @@ def load_documents(file_paths):
86
  logger.error(f"Error processing file {file_path}: {e}")
87
  return docs
88
 
89
- # Function to ensure the response ends with complete sentences using nltk
90
  def ensure_complete_sentences(text):
91
  sentences = sent_tokenize(text)
92
  if sentences:
 
18
  import pandas as pd
19
  import json
20
 
21
+ # Download required NLTK resources
22
  nltk.download('punkt')
23
 
24
  # Load spaCy English model
 
86
  logger.error(f"Error processing file {file_path}: {e}")
87
  return docs
88
 
89
+ # Function to ensure the response ends with complete sentences using NLTK
90
  def ensure_complete_sentences(text):
91
  sentences = sent_tokenize(text)
92
  if sentences: