mkaramb commited on
Commit
3b55d2c
·
verified ·
1 Parent(s): 88a3c99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -61,6 +61,9 @@ def process_images(uploaded_file):
61
  if uploaded_file is None:
62
  results_df = results_df.iloc[0:0] # Clear the DataFrame
63
  return "", "" # Return empty outputs if no file is uploaded
 
 
 
64
  file_path = uploaded_file.name # Gradio provides the file path through the .name attribute
65
  try:
66
  image_files = unzip_and_find_jpgs(file_path)
 
61
  if uploaded_file is None:
62
  results_df = results_df.iloc[0:0] # Clear the DataFrame
63
  return "", "" # Return empty outputs if no file is uploaded
64
+ else:
65
+ results_df = pd.DataFrame(columns=["Filename", "Extracted Text", "Translated Text"]) # Reinitialize the DataFrame
66
+
67
  file_path = uploaded_file.name # Gradio provides the file path through the .name attribute
68
  try:
69
  image_files = unzip_and_find_jpgs(file_path)