forestcalled/text-generation-webui
0
1import sys2from pathlib import Path3 4 5class RelativeImport:6 def __init__(self, path):7 self.import_path = Path(path)8 9 def __enter__(self):10 sys.path.insert(0, str(self.import_path))11 12 def __exit__(self, exc_type, exc_value, traceback):13 sys.path.remove(str(self.import_path))14 