Rajut commited on
Commit
a5ef2e4
·
verified ·
1 Parent(s): f4bce66

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -19,8 +19,16 @@ def read_txt(file_path):
19
  text = file.read()
20
  return text
21
 
 
 
 
22
  # Load text from the specified file
23
- text_file_path = '/home/user/app/content/lawsofpower.txt'
 
 
 
 
 
24
  user_query = read_txt(text_file_path)
25
 
26
  # Set up text processing components
 
19
  text = file.read()
20
  return text
21
 
22
+ # Determine the path to the content folder
23
+ content_folder = os.path.join(os.getcwd(), 'content')
24
+
25
  # Load text from the specified file
26
+ text_file_path = os.path.join(content_folder, 'lawsofpower.txt')
27
+
28
+ # Check if the file exists before attempting to read it
29
+ if not os.path.exists(text_file_path):
30
+ raise FileNotFoundError(f"The file '{text_file_path}' does not exist.")
31
+
32
  user_query = read_txt(text_file_path)
33
 
34
  # Set up text processing components