Chandranshu Jain commited on
Commit
785158e
1 Parent(s): df9ddf2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -36,6 +36,9 @@ Follow these simple steps to interact with the chatbot:
36
  def get_pdf(uploaded_file):
37
  if uploaded_file :
38
  temp_file = "./temp.pdf"
 
 
 
39
  with open(temp_file, "wb") as file:
40
  file.write(uploaded_file.getvalue())
41
  file_name = uploaded_file.name
 
36
  def get_pdf(uploaded_file):
37
  if uploaded_file :
38
  temp_file = "./temp.pdf"
39
+ # Delete the existing temp.pdf file if it exists
40
+ if os.path.exists(temp_file):
41
+ os.remove(temp_file)
42
  with open(temp_file, "wb") as file:
43
  file.write(uploaded_file.getvalue())
44
  file_name = uploaded_file.name