tykiww's picture
Update utilities/setup.py
3d28dde verified
raw
history blame
597 Bytes
import json
import os
from datasets import load_dataset
class get_files:
def load_markdown_file(file_path):
try:
with open(file_path, 'r') as f:
return f.read()
except FileNotFoundError:
return "File not found. Please check the file path."
except Exception as e:
return f"Error loading file: {str(e)}"
def json_cfg():
"""Retrieve configuration file"""
config_path = os.getenv('CONFIG_PATH')
with open(config_path, 'r') as file:
config = json.load(file)
return config