参考资料:

https://github.com/InternLM/tutorial/blob/main/langchain/readme.md#5-部署-web-demo

环境安装

使用chatgpt讲安装过程转化为几个脚本。

创建一个文件夹来存储这些脚本

Untitled

1依赖安装。conda 环境

#!/bin/bash

# Activate conda environment
bash /root/share/install_conda_env_internlm_base.sh InternLM

修改默认的conda

#!/bin/bash

# Name of the conda environment to set as default
ENV_NAME="InternLM"

# Check if .bashrc exists for Bash shell
if [ -f "$HOME/.bashrc" ]; then
    echo "Setting $ENV_NAME as the default environment in .bashrc for Bash shell..."
    echo "# Set Conda environment $ENV_NAME as default" >> $HOME/.bashrc
    echo "conda activate $ENV_NAME" >> $HOME/.bashrc
fi

# Check if .zshrc exists for Zsh shell
if [ -f "$HOME/.zshrc" ]; then
    echo "Setting $ENV_NAME as the default environment in .zshrc for Zsh shell..."
    echo "# Set Conda environment $ENV_NAME as default" >> $HOME/.zshrc
    echo "conda activate $ENV_NAME" >> $HOME/.zshrc
fi

echo "Done. Please restart your shell or open a new terminal session to see the changes."

# Step 3: Install dependencies required to run the InternLM demo
pip install modelscope==1.9.5
pip install transformers==4.35.2
pip install streamlit==1.24.0
pip install sentencepiece==0.1.99
pip install accelerate==0.24.1