Spaces:
Sleeping
Sleeping
Chandranshu Jain
commited on
Update app.py
Browse files
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
|