paralym commited on
Commit
eb138a3
1 Parent(s): 2ed44c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -363,7 +363,7 @@ def bot(history, temperature, top_p, max_output_tokens):
363
  with open(file_path, "rb") as file:
364
  file_data = file.read()
365
  file_hash = hashlib.md5(file_data).hexdigest()
366
- all_file_hash.append(file_hash)
367
 
368
  t = datetime.datetime.now()
369
  output_dir = os.path.join(
@@ -377,7 +377,7 @@ def bot(history, temperature, top_p, max_output_tokens):
377
  # Process and save images
378
  image = Image.open(file_path).convert("RGB")
379
  filename = os.path.join(output_dir, f"{file_hash}.jpg")
380
- all_file_path.append(filename)
381
  if not os.path.isfile(filename):
382
  print("Image saved to", filename)
383
  image.save(filename)
@@ -385,7 +385,7 @@ def bot(history, temperature, top_p, max_output_tokens):
385
  elif is_valid_video_filename(file_path):
386
  # Simplified video saving
387
  filename = os.path.join(output_dir, f"{file_hash}.mp4")
388
- all_file_path.append(filename)
389
  if not os.path.isfile(filename):
390
  print("Video saved to", filename)
391
  os.makedirs(os.path.dirname(filename), exist_ok=True)
 
363
  with open(file_path, "rb") as file:
364
  file_data = file.read()
365
  file_hash = hashlib.md5(file_data).hexdigest()
366
+ all_image_hash.append(file_hash)
367
 
368
  t = datetime.datetime.now()
369
  output_dir = os.path.join(
 
377
  # Process and save images
378
  image = Image.open(file_path).convert("RGB")
379
  filename = os.path.join(output_dir, f"{file_hash}.jpg")
380
+ all_image_path.append(filename)
381
  if not os.path.isfile(filename):
382
  print("Image saved to", filename)
383
  image.save(filename)
 
385
  elif is_valid_video_filename(file_path):
386
  # Simplified video saving
387
  filename = os.path.join(output_dir, f"{file_hash}.mp4")
388
+ all_image_path.append(filename)
389
  if not os.path.isfile(filename):
390
  print("Video saved to", filename)
391
  os.makedirs(os.path.dirname(filename), exist_ok=True)