Skip to content

Commit

Permalink
Offline (#28)
Browse files Browse the repository at this point in the history
* Update download_model.py

* Update download_model.py

* Update base.py

* api
  • Loading branch information
ypwhs authored Apr 23, 2023
1 parent c6458e9 commit 0a3f0be
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
26 changes: 16 additions & 10 deletions download_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@
from huggingface_hub import snapshot_download

model_name_list = [
'THUDM/chatglm-6b-int4-qe',
# 'THUDM/chatglm-6b-int4-qe',
'THUDM/chatglm-6b-int4',
'THUDM/chatglm-6b',
# 'THUDM/glm-10b-chinese',

'silver/chatglm-6b-int4-qe-slim',
'BelleGroup/BELLE-LLAMA-7B-2M-gptq',
'BelleGroup/BELLE-7B-gptq',
# 'BelleGroup/BELLE-LLAMA-7B-2M-gptq',
# 'BelleGroup/BELLE-7B-gptq',
# 'BelleGroup/BELLE-LLAMA-7B-2M',
# 'BelleGroup/BELLE-7B-2M',

'THUDM/chatglm-6b',
'THUDM/glm-10b-chinese',
'BelleGroup/BELLE-LLAMA-7B-2M',
'BelleGroup/BELLE-7B-2M',
'silver/chatglm-6b-slim',
'silver/chatglm-6b-int4-slim',
# 'silver/chatglm-6b-slim',
# 'silver/chatglm-6b-int4-slim',
# 'silver/chatglm-6b-int4-qe-slim',

'fnlp/moss-moon-003-base',
'fnlp/moss-moon-003-sft',
'fnlp/moss-moon-003-sft-plugin',
'fnlp/moss-moon-003-sft-int4',
'fnlp/moss-moon-003-sft-plugin-int4'
]

for model_name in model_name_list:
Expand Down
2 changes: 1 addition & 1 deletion predictors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def predict_continue(self, query, latest_message, max_length, top_p,
temperature=temperature):
history[-1] = (history[-1][0], response)
history_colorful = copy.deepcopy(history)
colorful_response = f'<span style="color:blue;">{latest_message}</span>{response[len(latest_message):]}'
colorful_response = f'<span style="color:red">{latest_message}</span>{response[len(latest_message):]}'
history_colorful[-1] = (history_colorful[-1][0], colorful_response)
yield history_colorful, '', ''
if not allow_generate[0]:
Expand Down
8 changes: 8 additions & 0 deletions start_api.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@echo off

cd /D "%~dp0"

echo Start app.py
python app_fastapi.py %*

pause
6 changes: 6 additions & 0 deletions start_offline_api.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo off

cd /D "%~dp0"

call env_offline.bat
call start_api.bat

0 comments on commit 0a3f0be

Please sign in to comment.