aquibmoin commited on
Commit
b5d8a7a
1 Parent(s): 26a842a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -45,9 +45,10 @@ def split_into_chunks(text, chunk_size=100):
45
 
46
  return chunks
47
 
48
- def semantic_search(query, file):
49
- if file is not None:
50
- document = file.read()
 
51
  chunks = split_into_chunks(document)
52
  response = query_similarity(query, chunks)
53
  return format_output(response)
 
45
 
46
  return chunks
47
 
48
+ def semantic_search(query, file_path):
49
+ if file_path is not None:
50
+ with open(file_path, 'r', encoding='utf-8') as file:
51
+ document = file.read()
52
  chunks = split_into_chunks(document)
53
  response = query_similarity(query, chunks)
54
  return format_output(response)