2023-04-12 20:36:03 +00:00
|
|
|
######
|
2023-06-08 06:58:02 +00:00
|
|
|
# Project : lollms-webui
|
2023-04-12 20:36:03 +00:00
|
|
|
# File : config.py
|
|
|
|
# Author : ParisNeo with the help of the community
|
|
|
|
# Supported by Nomic-AI
|
2023-05-21 20:46:02 +00:00
|
|
|
# license : Apache 2.0
|
2023-04-12 20:36:03 +00:00
|
|
|
# Description :
|
|
|
|
# A front end Flask application for llamacpp models.
|
|
|
|
# The official GPT4All Web ui
|
|
|
|
# Made by the community for the community
|
|
|
|
######
|
|
|
|
import yaml
|
|
|
|
|
2023-04-20 17:30:03 +00:00
|
|
|
__author__ = "parisneo"
|
2023-06-08 06:58:02 +00:00
|
|
|
__github__ = "https://github.com/ParisNeo/lollms-webui"
|
2023-04-20 17:30:03 +00:00
|
|
|
__copyright__ = "Copyright 2023, "
|
|
|
|
__license__ = "Apache 2.0"
|
|
|
|
|
2023-04-12 20:36:03 +00:00
|
|
|
def load_config(file_path):
|
2023-04-24 21:11:32 +00:00
|
|
|
with open(file_path, 'r', encoding='utf-8') as stream:
|
2023-04-12 20:36:03 +00:00
|
|
|
config = yaml.safe_load(stream)
|
2023-05-04 23:50:43 +00:00
|
|
|
|
2023-04-12 20:36:03 +00:00
|
|
|
return config
|
|
|
|
|
|
|
|
|
|
|
|
def save_config(config, filepath):
|
|
|
|
with open(filepath, "w") as f:
|
|
|
|
yaml.dump(config, f)
|