mirror of
https://github.com/cpacker/MemGPT.git
synced 2023-10-17 01:28:22 +03:00
support .txt extension
This commit is contained in:
@@ -3,7 +3,7 @@ import os
|
||||
DEFAULT = 'cs_phd'
|
||||
|
||||
def get_human_text(key=DEFAULT):
|
||||
filename = f'{key}.txt'
|
||||
filename = key if key.endswith('.txt') else f'{key}.txt'
|
||||
file_path = os.path.join(os.path.dirname(__file__), 'examples', filename)
|
||||
|
||||
if os.path.exists(file_path):
|
||||
|
||||
@@ -4,9 +4,9 @@ DEFAULT = 'sam'
|
||||
|
||||
|
||||
def get_persona_text(key=DEFAULT):
|
||||
filename = f'{key}.txt'
|
||||
filename = key if key.endswith('.txt') else f'{key}.txt'
|
||||
file_path = os.path.join(os.path.dirname(__file__), 'examples', filename)
|
||||
|
||||
|
||||
if os.path.exists(file_path):
|
||||
with open(file_path, 'r') as file:
|
||||
return file.read().strip()
|
||||
|
||||
Reference in New Issue
Block a user