Skip to content

Commit 2ba1d4d

Browse files
author
xusenlin
committed
support qwen2
1 parent f75a360 commit 2ba1d4d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020

2121
## 📢 新闻
2222

23+
+ 【2024.06.05】 已支持 `QWEN2` 模型,修改环境变量 `MODEL_NAME=qwen2` `PROMPT_NAME=qwen2`
24+
25+
2326
+ 【2024.06.05】 支持 `GLM4` 模型,修改环境变量 `MODEL_NAME=chatglm4` `PROMPT_NAME=chatglm4`
2427

2528

@@ -29,7 +32,7 @@
2932
+ 【2024.04.16】 支持 `Rerank` 重排序模型,[使用方式](./docs/RAG.md)
3033

3134

32-
+ 【2024.02.26】 `QWEN2` 模型需要修改环境变量 `MODEL_NAME=qwen2` `PROMPT_NAME=qwen2`
35+
+ 【2024.02.26】 `QWEN1.5` 模型需要修改环境变量 `MODEL_NAME=qwen2` `PROMPT_NAME=qwen2`
3336

3437

3538
+ 【2024.01.19】 添加 [InternLM2](https://github.com/InternLM/InternLM) 模型支持,[启动方式](https://github.com/xusenlinzy/api-for-open-llm/blob/master/docs/SCRIPT.md#internlm2)

api/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def create_vllm_engine():
9696
from vllm.engine.async_llm_engine import AsyncLLMEngine
9797
from api.core.vllm_engine import VllmEngine, LoRA
9898
except ImportError:
99-
return None
99+
raise ValueError("VLLM engine not available")
100100

101101
include = {
102102
"tokenizer_mode",
@@ -146,7 +146,7 @@ def create_llama_cpp_engine():
146146
from llama_cpp import Llama
147147
from api.core.llama_cpp_engine import LlamaCppEngine
148148
except ImportError:
149-
return None
149+
raise ValueError("Llama cpp engine not available")
150150

151151
include = {
152152
"n_gpu_layers",
@@ -172,12 +172,12 @@ def create_llama_cpp_engine():
172172

173173

174174
def create_tgi_engine():
175-
""" get llama.cpp generate engine for chat or completion. """
175+
""" get tgi generate engine for chat or completion. """
176176
try:
177177
from text_generation import AsyncClient
178178
from api.core.tgi import TGIEngine
179179
except ImportError:
180-
return None
180+
raise ValueError("TGI engine not available")
181181

182182
client = AsyncClient(SETTINGS.tgi_endpoint)
183183
logger.info("Using TGI engine")

0 commit comments

Comments
 (0)