Skip to content

Commit

Permalink
Fix remove
Browse files Browse the repository at this point in the history
  • Loading branch information
fakerybakery committed Jan 23, 2023
1 parent 55148d5 commit 2d77945
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def upload():
file.save(os.path.join('uploads', filename))
answers = nlp('uploads/' + filename, question)
if len(answers) == 0:
os.remove(os.path.join(os.getcwd(), 'uploads/' + filename))
return 'Sorry, I can\'t find the answer for that question. Please try again with a different document.'
answer = answers[0]
os.remove(os.path.join(os.getcwd(), 'uploads/' + filename))
Expand Down

0 comments on commit 2d77945

Please sign in to comment.