MZhaovo commited on
Commit
85de666
1 Parent(s): 6487726

fix: windwos因冒号导致出错

Browse files
locale/en_US.json CHANGED
@@ -135,5 +135,10 @@
135
  "在线搜索": "Web search",
136
  "关于": "About",
137
  "新对话 ": "New Chat ",
138
- "搜索(支持正则)...": "Search (supports regex)..."
 
 
 
 
 
139
  }
 
135
  "在线搜索": "Web search",
136
  "关于": "About",
137
  "新对话 ": "New Chat ",
138
+ "搜索(支持正则)...": "Search (supports regex)...",
139
+
140
+ "对话命名方式": "History naming method",
141
+ "根据日期时间": "By date and time",
142
+ "第一条提问": "By first question",
143
+ "模型自动总结(消耗tokens)": "Auto summary by LLM (Consume tokens)"
144
  }
locale/ja_JP.json CHANGED
@@ -135,5 +135,10 @@
135
  "在线搜索": "オンライン検索",
136
  "关于": "について",
137
  "新对话 ": "新しい会話 ",
138
- "搜索(支持正则)...": "検索(正規表現をサポート)..."
 
 
 
 
 
139
  }
 
135
  "在线搜索": "オンライン検索",
136
  "关于": "について",
137
  "新对话 ": "新しい会話 ",
138
+ "搜索(支持正则)...": "検索(正規表現をサポート)...",
139
+
140
+ "对话命名方式": "会話の命名方法",
141
+ "根据日期时间": "日付と時刻に基づいて",
142
+ "第一条提问": "最初の質問",
143
+ "模型自动总结(消耗tokens)": "モデルによる自動要約(トークン消費)"
144
  }
locale/ko_KR.json CHANGED
@@ -135,5 +135,10 @@
135
  "在线搜索": "온라인 검색",
136
  "关于": "관련",
137
  "新对话 ": "새 대화 ",
138
- "搜索(支持正则)...": "검색 (정규식 지원)..."
 
 
 
 
 
139
  }
 
135
  "在线搜索": "온라인 검색",
136
  "关于": "관련",
137
  "新对话 ": "새 대화 ",
138
+ "搜索(支持正则)...": "검색 (정규식 지원)...",
139
+
140
+ "对话命名方式": "대화 이름 설정",
141
+ "根据日期时间": "날짜 및 시간 기준",
142
+ "第一条提问": "첫 번째 질문",
143
+ "模型自动总结(消耗tokens)": "모델에 의한 자동 요약 (토큰 소비)"
144
  }
locale/ru_RU.json CHANGED
@@ -135,5 +135,10 @@
135
  "在线搜索": "Онлайн-поиск",
136
  "关于": "О программе",
137
  "新对话 ": "Новый диалог ",
138
- "搜索(支持正则)...": "Поиск (поддержка регулярности)..."
 
 
 
 
 
139
  }
 
135
  "在线搜索": "Онлайн-поиск",
136
  "关于": "О программе",
137
  "新对话 ": "Новый диалог ",
138
+ "搜索(支持正则)...": "Поиск (поддержка регулярности)...",
139
+
140
+ "对话命名方式": "Способ названия диалога",
141
+ "根据日期时间": "По дате и времени",
142
+ "第一条提问": "Первый вопрос",
143
+ "模型自动总结(消耗tokens)": "Автоматическое подведение итогов модели (потребление токенов)"
144
  }
locale/sv_SE.json CHANGED
@@ -135,5 +135,10 @@
135
  "在线搜索": "onlinesökning",
136
  "关于": "om",
137
  "新对话 ": "Ny dialog ",
138
- "搜索(支持正则)...": "Sök (stöd för reguljära uttryck)..."
 
 
 
 
 
139
  }
 
135
  "在线搜索": "onlinesökning",
136
  "关于": "om",
137
  "新对话 ": "Ny dialog ",
138
+ "搜索(支持正则)...": "Sök (stöd för reguljära uttryck)...",
139
+
140
+ "对话命名方式": "Dialognamn",
141
+ "根据日期时间": "Enligt datum och tid",
142
+ "第一条提问": "Första frågan",
143
+ "模型自动总结(消耗tokens)": "Modellens automatiska sammanfattning (förbrukar tokens)"
144
  }
modules/models/models.py CHANGED
@@ -267,7 +267,7 @@ class OpenAIClient(BaseLLMModel):
267
  ai_answer = match.group(1)
268
  try:
269
  history = [
270
- { "role": "system", "content": f"Please summarize the following conversation for a chat topic.\nNo more than 16 characters.\nNo special characters.\nReply in {language}."},
271
  { "role": "user", "content": f"User: {user_question}\nAssistant: {ai_answer}"}
272
  ]
273
  response = self._single_query_at_once(history, temperature=0.0)
@@ -278,7 +278,7 @@ class OpenAIClient(BaseLLMModel):
278
  logging.info(f"自动命名失败。{e}")
279
  filename = user_question[:16] + ".json"
280
  return self.rename_chat_history(filename, chatbot, user_name)
281
- elif name_chat_method == i18n("第一次提问"):
282
  filename = user_question[:16] + ".json"
283
  return self.rename_chat_history(filename, chatbot, user_name)
284
  else:
 
267
  ai_answer = match.group(1)
268
  try:
269
  history = [
270
+ { "role": "system", "content": f"Please summarize the following conversation for a chat topic.\nNo more than 16 characters.\nNo special characters.\nReply in user's language."},
271
  { "role": "user", "content": f"User: {user_question}\nAssistant: {ai_answer}"}
272
  ]
273
  response = self._single_query_at_once(history, temperature=0.0)
 
278
  logging.info(f"自动命名失败。{e}")
279
  filename = user_question[:16] + ".json"
280
  return self.rename_chat_history(filename, chatbot, user_name)
281
+ elif name_chat_method == i18n("第一条提问"):
282
  filename = user_question[:16] + ".json"
283
  return self.rename_chat_history(filename, chatbot, user_name)
284
  else:
modules/presets.py CHANGED
@@ -134,8 +134,8 @@ REPLY_LANGUAGES = [
134
  ]
135
 
136
  HISTORY_NAME_METHODS = [
137
- i18n("根据时间"),
138
- i18n("第一次提问"),
139
  i18n("模型自动总结(消耗tokens)"),
140
  ]
141
 
 
134
  ]
135
 
136
  HISTORY_NAME_METHODS = [
137
+ i18n("根据日期时间"),
138
+ i18n("第一条提问"),
139
  i18n("模型自动总结(消耗tokens)"),
140
  ]
141
 
modules/utils.py CHANGED
@@ -668,7 +668,7 @@ def new_auto_history_filename(username):
668
  with open(os.path.join(HISTORY_DIR, username, latest_file + ".json"), 'r', encoding="utf-8") as f:
669
  if len(f.read()) == 0:
670
  return latest_file
671
- now = i18n("新对话 ") + datetime.datetime.now().strftime('%m-%d %H:%M')
672
  return f'{now}.json'
673
 
674
  def get_history_filepath(username):
 
668
  with open(os.path.join(HISTORY_DIR, username, latest_file + ".json"), 'r', encoding="utf-8") as f:
669
  if len(f.read()) == 0:
670
  return latest_file
671
+ now = i18n("新对话 ") + datetime.datetime.now().strftime('%m-%d %H꞉%M')
672
  return f'{now}.json'
673
 
674
  def get_history_filepath(username):