# xai **Repository Path**: cherishd/xai ## Basic Information - **Project Name**: xai - **Description**: xai xai xai xai - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-04 - **Last Updated**: 2026-03-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: AI ## README # xai 介绍 ## p01_a_basic python 基础:day01-day15 , 无 day16-day20 ## p02_dsa 数据结构:day21-day25 ## p07_deeplearn torch 环境 ```shell # 需要指定python版本, 避免不兼容 conda create -n tor python=3.12 "numpy<2" -y conda activate tor conda deactivate #退出当前环境 # torch cpu 环境 conda install "pytorch>=2.4" torchvision torchaudio cpuonly -c pytorch -y # 数据分析常用库 conda install -c conda-forge jupyter notebook "numpy<2" pandas scikit-learn matplotlib -y pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ jieba ``` ## p08_image_processing ```shell conda activate tor conda install -c conda-forge flask tqdm -y ``` ## p09_nlp #### word_represent ```text word_represent 资料下载: 1, 使用用公开词向量 sgns.weibo.word.bz2 词向量文件包含195202个词,每个词向量300维。 https://github.com/Embedding/Chinese-Word-Vectors?tab=readme-ov-file https://pan.baidu.com/s/1zbuUJEEEpZRNHxZ7Gezzmw 2, 自行训练词向量 online_shopping_10_cats.csv api参考:https://radimrehurek.com/gensim/models/word2vec.html 下载情感/观点/评论 倾向性分析,online_shopping_10_cats: https://github.com/InsaneLife/ChineseNLPCorpus?tab=readme-ov-file compl列表表达式, [ for in] ``` #### input-method ```text # input-method 安装训练过程中,loss数据看板 conda install -c conda-forge tensorboard tensorboard --logdir input-method/test/test_logs # 按住alt 可以放大缩图片, 可以设置自动刷新 ``` #### translation-seq2seq ```text # translation-seq2seq 安装分词工具 nltk ,并下载词库 conda install -c conda-forge nltk nltk.download('punkt_tab') ``` #### hugging-face ```text # 见word文档附录部分, 有hugging-face子文档 用 Pip 安装 Hugging Face 生态(关键!) # 核心四件套(必装) pip install transformers tokenizers datasets huggingface_hub # 推荐扩展(按需加) pip install evaluate accelerate # 多模态/图像生成(按需) pip install diffusers invisible-watermark # 语音(按需) pip install librosa soundfile 或者 建立文件 requirements.txt torch>=2.5.0 transformers>=4.40.0 tokenizers>=0.20.0 datasets>=3.2.0 huggingface_hub>=0.26.0 evaluate>=0.4.0 accelerate>=1.0.0 numpy>=1.26.0 pyarrow>=17.0.0 pip install -r requirements.txt pip install jieba -y 需要下载bert-base-chinese词库 huggingface-cli download bert-base-chinese --local-dir ./pretrained/bert-base-chinese 国内环境下载 pip install modelscope modelscope download --model google-bert/bert-base-chinese README.md --local_dir ./dir https://hf-mirror.com/ 还需要将pytorch 升级2.4版本以上, 可以新建一个conda 环境, 供参考 conda install -c pytorch -c conda-forge "pytorch>=2.4" cpuonly --force-reinstall --update-deps -y 尚硅谷AI大模型教程资料合集: https://pan.baidu.com/s/1kB3jdw2oPHwQNGDJbSGlog?pwd=yyds 提取码: yyds ``` ---------------------------------------------------------- ## Python 环境: ### 常见 conda 库 ```shell # jupyterlab 比 jupyter 高级, 包含 notebook conda install -c conda-forge jupyterlab -y # 启动 JupyterLab jupyter lab # 启动传统 Notebook jupyter notebook # 可选安装, 数据分析常用库 conda install -c conda-forge scipy seaborn openpyxl xlrd pyarrow -y # pip 命令 pip list pip show numpy pip search keyword pip install requests==2.31.0 pip uninstall flask pip install --upgrade pip # 升级 pip 自身 pip freeze > requirements.txt pip install -r requirements.txt # conda 命令 conda install -c conda-forge pandas conda update numpy conda update --all conda search scikit-learn conda remove requests pip list | findstr jieba conda list | findstr jieba ``` ### scoop 安装 , conda 安装 idea ```text # 使用scoop 安装开发环境 https://gitee.com/scoop-installer/scoop ``` ### conda 安装 ```shell # 打开官网:👉 https://docs.conda.io/en/latest/miniconda.html # 务必勾选以下两项: # ✅ Add Miniconda3 to my PATH environment variable # (允许在 CMD/PowerShell 中直接使用 conda 命令) # ✅ Register Miniconda3 as my default Python # (让 python 命令指向 Conda 的 Python) # 将 conda-forge 添加到频道列表,并设为优先, 不用每次 conda install 指定 -c conda-forge conda config --show channels conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ conda config --set auto_activate_base false conda config --add channels conda-forge conda config --set channel_priority strict conda init powershell # 测试 conda 环境 conda info conda --version python --version conda env list # conda info --envs conda config --show envs_dirs conda create -n test python=3.12 -y conda activate test python -c "print('🎉 Conda 安装成功!')" conda deactivate conda remove -n test --all -y conda env export --from-history > environment.yml # --from-history 只记录你显式安装的包(不含自动依赖),更干净 conda env create -f environment.yml # 用法注意 # 不要在 base 环境装项目依赖, 不要在 base 环境中直接 pip install # 先用 conda 安装(尤其科学计算包) # conda 找不到的,再用 pip # 先用 pip 装一堆包,再用 conda 装其他 → 极易导致依赖冲突 ```