Interface with LLaMa2 from huggingface

This commit is contained in:
binary-husky
2023-08-21 21:54:21 +08:00
parent 8b3b883fce
commit 9720bec5e5
4 changed files with 113 additions and 2 deletions

View File

@@ -385,6 +385,22 @@ if "spark" in AVAIL_LLM_MODELS: # 讯飞星火认知大模型
})
except:
print(trimmed_format_exc())
if "llama2" in AVAIL_LLM_MODELS: # 讯飞星火认知大模型
try:
from .bridge_llama2 import predict_no_ui_long_connection as llama2_noui
from .bridge_llama2 import predict as llama2_ui
model_info.update({
"llama2": {
"fn_with_ui": llama2_ui,
"fn_without_ui": llama2_noui,
"endpoint": None,
"max_token": 4096,
"tokenizer": tokenizer_gpt35,
"token_cnt": get_token_num_gpt35,
}
})
except:
print(trimmed_format_exc())