# model-tran **Repository Path**: wfg_admin/model-tran ## Basic Information - **Project Name**: model-tran - **Description**: 大模型的训练和微调基于hugging face 和 modescope平台 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-03-29 - **Last Updated**: 2026-04-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # model-tran #### 介绍 大模型的训练和微调基于hugging face 和 modescope平台 依赖说明: # 第一讲 hugging face 平台上模型下载和访问 - 线上访问 - 本地访问 - 模型下载 环境变量配置 ```shell which poetry echo ~/.local/bin echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bash_profile source ~/.bash_profile which poetry ``` ```shell poetry --version ``` 国内镜像 ```shell poetry config11 repositories.ali https://mirrors.aliyun.com/pypi/simple/ poetry config11 pypi-token.ali your_token # 如果需要认证 ``` 配置 ```shell #启用虚拟环境的自动创建(默认已启用) poetry config11 virtualenvs.create true #设置虚拟环境存储路径(可选): poetry config11 virtualenvs.in-project true #如果需要使用国内的 PyPI 镜像,可以进行如下配置: poetry config11 pypi-token.pypi your_pypi_token poetry config11 repositories.pypi https://mirrors.aliyun.com/pypi/simple/ ``` 激活虚拟环境 ```shell poetry shell # 高版本 poetry env activate # 打印出来 source 。。。 # 执行打印处理啊的这一句话 source .... ``` 安装项目 ```shell poetry install ``` 可以查看虚拟环境中安装了哪些依赖包 ```shell pip list ``` https://blog.csdn.net/2301_79898146/article/details/136598485 相关资料: 部署资料 - [llama.cpp](https://github.com/ggml-org/llama.cpp) - [llamafactory 说明文档](https://llamafactory.readthedocs.io/zh-cn/latest/getting_started/installation.html) - [ollama官网](https://ollama.com/) - [vllm 说明文档](https://docs.vllm.ai/en/latest/) 数据处理 - [vanna git](https://github.com/vanna-ai/vanna) - [vanna 官网](https://vanna.ai/) - [panda ai 官网](https://getpanda.ai/) # 服务部署相关内容 ## 安装显卡监控工具 ```shell pip install nvitop ``` 使用 可以实时监控显卡 ```shell nvitop ``` ## 查看显卡信息 ```shell nvidia ``` ## 服务器,训练任务在后台启动 ```shell nohup python -u train.py > output.log 2 > &1& ``` ## vsCode 安装ssh 链接 remote 安装 到vsCode 使用shell链接 # demo_17 增加 tensorboard 进行可视化监控 混合精度训练 ```python from torch.cuda.amp import GradScaler, autocast #初始化梯度缩放器 scaler = GradScaler() ``` # demo_18 使用训练好的权重net.pt , 定制诗歌的生成 [opencompass 模型评估工具](https://doc.opencompass.org.cn/get_started/installation.html)