From f29443ffb020d78d6e443f7af68f74564e4b5326 Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Mon, 16 Mar 2026 11:30:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=92=8C=E7=8E=AF=E5=A2=83=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- vsp/qwen3.5-9b/requirements.txt | 10 +++++++ vsp/qwen3.5-9b/setup_env.py | 49 +++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 vsp/qwen3.5-9b/requirements.txt create mode 100644 vsp/qwen3.5-9b/setup_env.py diff --git a/vsp/qwen3.5-9b/requirements.txt b/vsp/qwen3.5-9b/requirements.txt new file mode 100644 index 0000000..46968d7 --- /dev/null +++ b/vsp/qwen3.5-9b/requirements.txt @@ -0,0 +1,10 @@ +modelscope>=1.9.0 +transformers>=4.37.0 +accelerate>=0.25.0 +bitsandbytes>=0.41.0 +sentencepiece +protobuf +psutil +pandas +matplotlib +tqdm diff --git a/vsp/qwen3.5-9b/setup_env.py b/vsp/qwen3.5-9b/setup_env.py new file mode 100644 index 0000000..640d1aa --- /dev/null +++ b/vsp/qwen3.5-9b/setup_env.py @@ -0,0 +1,49 @@ +"""环境检查与依赖验证脚本""" +import subprocess +import sys + + +def check_and_install(): + """检查并安装依赖""" + print("=" * 60) + print("Qwen3.5-9B 测试环境检查") + print("=" * 60) + + # 检查 Python 版本 + print(f"\nPython 版本: {sys.version}") + + # 检查 CUDA + try: + import torch + print(f"PyTorch 版本: {torch.__version__}") + print(f"CUDA 可用: {torch.cuda.is_available()}") + if torch.cuda.is_available(): + print(f"GPU: {torch.cuda.get_device_name(0)}") + vram_gb = torch.cuda.get_device_properties(0).total_memory / 1024**3 + print(f"VRAM: {vram_gb:.1f} GB") + except ImportError: + print("ERROR: PyTorch 未安装") + sys.exit(1) + + # 安装依赖 + print("\n安装依赖包...") + subprocess.check_call([ + sys.executable, "-m", "pip", "install", "-r", + "vsp/qwen3.5-9b/requirements.txt", "-q" + ]) + + # 验证关键包 + packages = ["transformers", "modelscope", "accelerate", "bitsandbytes"] + for pkg in packages: + try: + mod = __import__(pkg) + ver = getattr(mod, "__version__", "unknown") + print(f" {pkg}: {ver}") + except ImportError: + print(f" ERROR: {pkg} 安装失败") + + print("\n环境检查完成!") + + +if __name__ == "__main__": + check_and_install()