mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-05 10:05:05 +08:00
Compare commits
2 Commits
38be53cf31
...
a1f848bfe0
| Author | SHA1 | Date | |
|---|---|---|---|
| a1f848bfe0 | |||
| f2309ff93e |
@ -870,6 +870,7 @@ class MistralChat(Base):
|
|||||||
return gen_conf
|
return gen_conf
|
||||||
|
|
||||||
def _chat(self, history, gen_conf={}, **kwargs):
|
def _chat(self, history, gen_conf={}, **kwargs):
|
||||||
|
gen_conf = self._clean_conf(gen_conf)
|
||||||
response = self.client.chat(model=self.model_name, messages=history, **gen_conf)
|
response = self.client.chat(model=self.model_name, messages=history, **gen_conf)
|
||||||
ans = response.choices[0].message.content
|
ans = response.choices[0].message.content
|
||||||
if response.choices[0].finish_reason == "length":
|
if response.choices[0].finish_reason == "length":
|
||||||
@ -882,9 +883,7 @@ class MistralChat(Base):
|
|||||||
def chat_streamly(self, system, history, gen_conf={}, **kwargs):
|
def chat_streamly(self, system, history, gen_conf={}, **kwargs):
|
||||||
if system and history and history[0].get("role") != "system":
|
if system and history and history[0].get("role") != "system":
|
||||||
history.insert(0, {"role": "system", "content": system})
|
history.insert(0, {"role": "system", "content": system})
|
||||||
for k in list(gen_conf.keys()):
|
gen_conf = self._clean_conf(gen_conf)
|
||||||
if k not in ["temperature", "top_p", "max_tokens"]:
|
|
||||||
del gen_conf[k]
|
|
||||||
ans = ""
|
ans = ""
|
||||||
total_tokens = 0
|
total_tokens = 0
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -43,6 +43,7 @@ export const LanguageList = [
|
|||||||
'English',
|
'English',
|
||||||
'Chinese',
|
'Chinese',
|
||||||
'Traditional Chinese',
|
'Traditional Chinese',
|
||||||
|
'Russian',
|
||||||
'Indonesia',
|
'Indonesia',
|
||||||
'Spanish',
|
'Spanish',
|
||||||
'Vietnamese',
|
'Vietnamese',
|
||||||
@ -55,6 +56,7 @@ export const LanguageMap = {
|
|||||||
English: 'English',
|
English: 'English',
|
||||||
Chinese: '简体中文',
|
Chinese: '简体中文',
|
||||||
'Traditional Chinese': '繁體中文',
|
'Traditional Chinese': '繁體中文',
|
||||||
|
Russian: 'Русский',
|
||||||
Indonesia: 'Indonesia',
|
Indonesia: 'Indonesia',
|
||||||
Spanish: 'Español',
|
Spanish: 'Español',
|
||||||
Vietnamese: 'Tiếng việt',
|
Vietnamese: 'Tiếng việt',
|
||||||
@ -68,6 +70,7 @@ export enum LanguageAbbreviation {
|
|||||||
En = 'en',
|
En = 'en',
|
||||||
Zh = 'zh',
|
Zh = 'zh',
|
||||||
ZhTraditional = 'zh-TRADITIONAL',
|
ZhTraditional = 'zh-TRADITIONAL',
|
||||||
|
Ru = 'ru',
|
||||||
Id = 'id',
|
Id = 'id',
|
||||||
Ja = 'ja',
|
Ja = 'ja',
|
||||||
Es = 'es',
|
Es = 'es',
|
||||||
@ -81,6 +84,7 @@ export const LanguageAbbreviationMap = {
|
|||||||
[LanguageAbbreviation.En]: 'English',
|
[LanguageAbbreviation.En]: 'English',
|
||||||
[LanguageAbbreviation.Zh]: '简体中文',
|
[LanguageAbbreviation.Zh]: '简体中文',
|
||||||
[LanguageAbbreviation.ZhTraditional]: '繁體中文',
|
[LanguageAbbreviation.ZhTraditional]: '繁體中文',
|
||||||
|
[LanguageAbbreviation.Ru]: 'Русский',
|
||||||
[LanguageAbbreviation.Id]: 'Indonesia',
|
[LanguageAbbreviation.Id]: 'Indonesia',
|
||||||
[LanguageAbbreviation.Es]: 'Español',
|
[LanguageAbbreviation.Es]: 'Español',
|
||||||
[LanguageAbbreviation.Vi]: 'Tiếng việt',
|
[LanguageAbbreviation.Vi]: 'Tiếng việt',
|
||||||
@ -94,6 +98,7 @@ export const LanguageTranslationMap = {
|
|||||||
English: 'en',
|
English: 'en',
|
||||||
Chinese: 'zh',
|
Chinese: 'zh',
|
||||||
'Traditional Chinese': 'zh-TRADITIONAL',
|
'Traditional Chinese': 'zh-TRADITIONAL',
|
||||||
|
Russian: 'ru',
|
||||||
Indonesia: 'id',
|
Indonesia: 'id',
|
||||||
Spanish: 'es',
|
Spanish: 'es',
|
||||||
Vietnamese: 'vi',
|
Vietnamese: 'vi',
|
||||||
|
|||||||
Reference in New Issue
Block a user