kenfoo commited on
Commit
3b8c9e5
·
verified ·
1 Parent(s): ec3d6af

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -33,8 +33,8 @@ def encode_image_to_gallery_dict(image_path):
33
  if not image_path or not isinstance(image_path, str):
34
  return None
35
  try:
36
- file_data = handle_file(image_path)
37
- return {"image": file_data, "caption": ""}
38
  except Exception as e:
39
  print(f"无法读取图片: {image_path}: {e}")
40
  return None
@@ -75,6 +75,7 @@ def infer(
75
 
76
  print("[调用API] space_client.predict 输入参数:")
77
  print(f" images count: {len(images_input)}")
 
78
  print(f" prompt: {prompt}")
79
  print(f" lora_adapter: {lora_adapter}")
80
  print(f" seed: {seed}")
 
33
  if not image_path or not isinstance(image_path, str):
34
  return None
35
  try:
36
+ # Gallery with type="filepath" expects (handle_file, caption) tuple
37
+ return (handle_file(image_path), None)
38
  except Exception as e:
39
  print(f"无法读取图片: {image_path}: {e}")
40
  return None
 
75
 
76
  print("[调用API] space_client.predict 输入参数:")
77
  print(f" images count: {len(images_input)}")
78
+ print(f" images structure: {images_input}")
79
  print(f" prompt: {prompt}")
80
  print(f" lora_adapter: {lora_adapter}")
81
  print(f" seed: {seed}")