fcernafukuzaki commited on
Commit
2235554
·
1 Parent(s): 6d635c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -63,15 +63,17 @@ def ask(dataset, pregunta):
63
  if dataset is None:
64
  return ""
65
  path_file = dataset.name
 
66
  extension = os.path.splitext(path_file)[1]
 
67
  dir_name = str(Path(path_file).parent)
 
68
 
69
  if extension.lower() == ".pdf":
70
  chatbot = ChatBotInmobiliaria()
71
  DATASET_JSON = "dataset_file.json"
72
  chatbot.create_dataset(dir_name, DATASET_JSON)
73
  chatbot.load_dataset(DATASET_JSON)
74
- chatbot.load_dataset(path_file)
75
  return chatbot.ask(question=pregunta)
76
  elif extension.lower() == ".json":
77
  chatbot = ChatBotInmobiliaria()
 
63
  if dataset is None:
64
  return ""
65
  path_file = dataset.name
66
+ print(f"Nombre del archivo: {path_file}")
67
  extension = os.path.splitext(path_file)[1]
68
+ print(f"Extensión el archivo: {extension}")
69
  dir_name = str(Path(path_file).parent)
70
+ print(f"Carpeta donde está ubicado el archivo: {dir_name}")
71
 
72
  if extension.lower() == ".pdf":
73
  chatbot = ChatBotInmobiliaria()
74
  DATASET_JSON = "dataset_file.json"
75
  chatbot.create_dataset(dir_name, DATASET_JSON)
76
  chatbot.load_dataset(DATASET_JSON)
 
77
  return chatbot.ask(question=pregunta)
78
  elif extension.lower() == ".json":
79
  chatbot = ChatBotInmobiliaria()