Spaces:
Runtime error
Runtime error
Update app.py
Browse filesReapply fix for accessing response.summary_text
15 unmodified lines161718192021222315 unmodified linestry:response = client.summarization(text)print(f"API Response: {response}")# 直接访问 response.summary_textreturn response.summary_text if hasattr(response, 'summary_text') else "摘要生成失败,请重试。"except Exception as e:error_details = traceback.format_exc()print(f"尝试失败,错误类型: {type(e).__name__}, 错误详情: {str(e)}, 堆栈: {error_details}")15 unmodified lines161718192021222315 unmodified linestry:response = client.summarization(text)print(f"API Response: {response}")# 直接访问 summary_textreturn response.summary_text if hasattr(response, 'summary_text') else "摘要生成失败,属性缺失。"except Exception as e:error_details = traceback.format_exc()print(f"尝试失败,错误类型: {type(e).__name__}, 错误详情: {str(e)}, 堆栈: {error_details}")
app.py+2-2