GattoNero commited on
Commit
5b9a774
·
verified ·
1 Parent(s): e308dfe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -3,6 +3,7 @@ import gradio as gr
3
  import requests
4
  import inspect
5
  import pandas as pd
 
6
  import logging
7
  #from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, OpenAIServerModel
8
  from pathlib import Path
@@ -362,7 +363,7 @@ def _load_excel_as_text(file_name: str) -> str:
362
 
363
  # Scarica il file se non esiste localmente
364
  if not os.path.exists(file_path):
365
- print(f"[INFO] File {file_name} non trovato. Scarico...")
366
  url = f"https://huggingface.co/datasets/gaia-benchmark/GAIA/resolve/main/2023/validation/{file_name}"
367
  headers = {"Authorization": f"Bearer {hf_token}"}
368
  try:
@@ -377,8 +378,10 @@ def _load_excel_as_text(file_name: str) -> str:
377
 
378
  # Leggi il contenuto
379
  try:
380
- xl = pd.ExcelFile(file_path)
381
- sheets = xl.sheet_names
 
 
382
 
383
  xl = xl.applymap(lambda x: f"{x:.2f}" if isinstance(x, float) else x)
384
 
 
3
  import requests
4
  import inspect
5
  import pandas as pd
6
+ from io import StringIO
7
  import logging
8
  #from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, OpenAIServerModel
9
  from pathlib import Path
 
363
 
364
  # Scarica il file se non esiste localmente
365
  if not os.path.exists(file_path):
366
+ print_coso(f"[INFO] File {file_name} non trovato. Scarico...")
367
  url = f"https://huggingface.co/datasets/gaia-benchmark/GAIA/resolve/main/2023/validation/{file_name}"
368
  headers = {"Authorization": f"Bearer {hf_token}"}
369
  try:
 
378
 
379
  # Leggi il contenuto
380
  try:
381
+ #xl = pd.ExcelFile(file_path)
382
+ xl.read_excel(input_excel_path)
383
+ print_coso(f"excel: {xl}")
384
+ #sheets = xl.sheet_names
385
 
386
  xl = xl.applymap(lambda x: f"{x:.2f}" if isinstance(x, float) else x)
387