@@ -93,8 +93,6 @@ def __init__(
9393 filepath (str, optional): Path to file containing conversation history. Defaults to None.
9494 update_file (bool, optional): Add new prompts and responses to the file. Defaults to True.
9595 """
96- # I was thinking of introducing offset so as to control payload size. (prompt)
97- # What's your thought on that? Give a PR or raise an issue
9896 self .status = status
9997 self .max_tokens_to_sample = max_tokens
10098 self .chat_history = self .intro
@@ -103,8 +101,7 @@ def __init__(
103101 self .update_file = update_file
104102 self .history_offset = 10250
105103 self .prompt_allowance = 10
106- if filepath :
107- self .load_conversation (filepath , False )
104+ self .load_conversation (filepath , False ) if filepath else None
108105
109106 def load_conversation (self , filepath : str , exists : bool = True ) -> None :
110107 """Load conversation into chat's history from .txt file
@@ -176,7 +173,7 @@ def update_chat_history(self, prompt: str, response: str) -> None:
176173 if self .file and self .update_file :
177174 with open (self .file , "a" ) as fh :
178175 fh .write (new_history )
179- self .chat_history += new_history if self . status else ""
176+ self .chat_history += new_history
180177
181178
182179class AwesomePrompts :
@@ -215,7 +212,7 @@ def get_acts(self):
215212 def update_prompts_from_online (self , override : bool = False ):
216213 """Download awesome-prompts and update existing ones if available
217214 args:
218- override (bool, optional): Override existing contents in path
215+ override (bool, optional): Overwrite existing contents in path
219216 """
220217 resp = {}
221218 if not self .__is_prompt_updated :
0 commit comments