适配网关3.5

This commit is contained in:
w_xiaolizu
2023-06-09 10:33:54 +08:00
parent 955367b0bc
commit f74dd47d01
2 changed files with 10 additions and 1 deletions

View File

@ -532,7 +532,7 @@ def reuse_chat(result, chatbot, history, pro_numb):
i_say = pattern.sub('', chatbot[-1][0])
return chatbot, history, i_say, gr.Tabs.update(selected='chatbot'), ''
@timeStatistics
def num_tokens_from_string(listing: list, encoding_name: str = 'cl100k_base') -> int:
"""Returns the number of tokens in a text string."""
count_tokens = 0

View File

@ -95,6 +95,15 @@ model_info = {
"token_cnt": get_token_num_gpt4,
},
"proxy-gpt-35-turbo-version-0301": {
"fn_with_ui": chatgpt_ui,
"fn_without_ui": chatgpt_noui,
"endpoint": proxy_endpoint.replace('%v', 'gpt-35-turbo-version-0301'),
"max_token": 8192,
"tokenizer": tokenizer_gpt4,
"token_cnt": get_token_num_gpt4,
},
"proxy-gpt-4": {
"fn_with_ui": chatgpt_ui,
"fn_without_ui": chatgpt_noui,