Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -215,14 +215,14 @@ class BasicAgent:
|
|
215 |
return None
|
216 |
|
217 |
def _load_bytes(self, file_name: str) -> bytes:
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
def _load_text(self, data: str) -> str:
|
227 |
return base64.b64decode(data).decode("utf-8")
|
228 |
|
|
|
215 |
return None
|
216 |
|
217 |
def _load_bytes(self, file_name: str) -> bytes:
|
218 |
+
file_path = os.path.join("/data", file_name)
|
219 |
+
try:
|
220 |
+
with open(file_path, "rb") as f:
|
221 |
+
return f.read()
|
222 |
+
except Exception as e:
|
223 |
+
print_coso(f"Error loading file {file_path}: {e}")
|
224 |
+
return None
|
225 |
+
|
226 |
def _load_text(self, data: str) -> str:
|
227 |
return base64.b64decode(data).decode("utf-8")
|
228 |
|