Spaces:
Build error
Build error
Update app.py
Browse files23 unmodified lines24252627282930318 unmodified lines4041424344454623 unmodified linesif file is None:return "請上傳一個 Excel 文件。"try:# 讀取 Excel 文件df = pd.read_excel(file)# 提取 "Output" 和 "Initial Output" 列並返回第一行output_first_line = parse_markdown(str(df["Output"].iloc[0])) if "Output" in df.columns else "Output 列不存在。"initial_output_first_line = parse_markdown(str(df["Initial Output"].iloc[0])) if "Initial Output" in df.columns else "Initial Output 列不存在。"8 unmodified linesif not os.path.exists(default_excel_path):return "預設的 Excel 文件不存在。"try:# 讀取 Excel 文件df = pd.read_excel(default_excel_path)# 提取 "Output" 和 "Initial Output" 列並返回第一行output_first_line = parse_markdown(str(df["Output"].iloc[0])) if "Output" in df.columns else "Output 列不存在。"23 unmodified lines24252627282930318 unmodified lines4041424344454623 unmodified linesif file is None:return "請上傳一個 Excel 文件。"try:# 使用 pandas 讀取 Excel 文件df = pd.read_excel(file.name) # `file.name` 是文件的路徑# 提取 "Output" 和 "Initial Output" 列並返回第一行output_first_line = parse_markdown(str(df["Output"].iloc[0])) if "Output" in df.columns else "Output 列不存在。"initial_output_first_line = parse_markdown(str(df["Initial Output"].iloc[0])) if "Initial Output" in df.columns else "Initial Output 列不存在。"8 unmodified linesif not os.path.exists(default_excel_path):return "預設的 Excel 文件不存在。"try:# 使用 pandas 讀取 Excel 文件df = pd.read_excel(default_excel_path)# 提取 "Output" 和 "Initial Output" 列並返回第一行output_first_line = parse_markdown(str(df["Output"].iloc[0])) if "Output" in df.columns else "Output 列不存在。"
app.py+3-3