Varhal commited on
Commit
6fd2189
·
verified ·
1 Parent(s): 4db9c4b

try fix error

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -64,8 +64,9 @@ def generate(text, file_name, model="gemini-2.0-flash-exp"):
64
  continue
65
  candidate = chunk.candidates[0].content.parts[0]
66
 
67
- text_response += chunk.text + "\n"
68
-
 
69
 
70
  if candidate.inline_data:
71
  save_binary_file(temp_path, candidate.inline_data.data)
 
64
  continue
65
  candidate = chunk.candidates[0].content.parts[0]
66
 
67
+ text_part = getattr(candidate, "text", "")
68
+ if text_part:
69
+ text_response += text_part + "\n"
70
 
71
  if candidate.inline_data:
72
  save_binary_file(temp_path, candidate.inline_data.data)