Skip to content

Commit

Permalink
添加更多的输出,追踪日志
Browse files Browse the repository at this point in the history
  • Loading branch information
JieGenius committed Mar 3, 2024
1 parent eeb489d commit ea0ee3d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
MODEL_REPOSITORY_OPENXLAB = "OpenLMLab/internlm2-chat-7b"

if __name__ == '__main__':
print("ls /usr/local")
os.system("ls /usr/local")
if not os.path.exists(MODEL_DIR):
from openxlab.model import download

Expand All @@ -16,6 +16,6 @@
print("解压后目录结果如下:")
print(os.listdir(MODEL_DIR))
os.system(f"lmdeploy convert internlm2-chat-7b {MODEL_DIR}")
os.system("lmdeploy serve api_server ./workspace --server-name 0.0.0.0 --server-port 23333 --tp 1 --cache-max-entry-count 0.5 >/dev/null 2>&1 &")
os.system("lmdeploy serve api_server ./workspace --server-name 0.0.0.0 --server-port 23333 --tp 1 --cache-max-entry-count 0.5 &")
time.sleep(5)
os.system('streamlit run web_demo.py --server.address=0.0.0.0 --server.port 7860 --server.enableStaticServing True --server.enableStaticServing true')
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pandas
python-docx
torch
torchvision
# torch
# torchvision
modelscope
transformers
xtuner[all]
Expand Down
7 changes: 6 additions & 1 deletion web_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import json
import os
import re

import torch
import streamlit as st

from lagent.actions import ActionExecutor
Expand Down Expand Up @@ -356,6 +356,11 @@ def main():


if __name__ == '__main__':
print("torch.cuda.is_available():", torch.cuda.is_available())
print("torch.__version__:", torch.__version__)
print("torch.version.cuda:", torch.version.cuda)
print("torch.cuda.get_device_name(0):", torch.cuda.get_device_name(0))
print("nvidia-smi:", os.popen('nvidia-smi').read())
root_dir = 'static'
os.makedirs(root_dir, exist_ok=True)
main()

0 comments on commit ea0ee3d

Please sign in to comment.