Python 学习笔记 01

@极客时间《AI 大模型应用开发实战营》

1. 安装Python

2. 安装PyCharm
  • 下载链接🔗

    https://www.jetbrains.com/zh-cn/pycharm/download/#section=mac
    
  • 创建工程

    New Project -> Add Interpreter -> Add Local Interpreter
    
  • 简单实例

    • 创建文件,并输入:

      print("Hello World!")
      
    • 右键Run,应输出:

      Hello World!
      
3. 安装JupyterLab
  • 安装pip

    python3 -m ensurepip
    curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
    python3 get-pip.py
    pip -v
    
  • 安装JupyterLab

    pip install jupyterlab
    
4. 开发准备
  • 设置环境变量

    export OPENAI_API_KEY='api-key'
    
  • 克隆OpenAI快速入门存储库

    git clone https://github.com/DjangoPeng/openai-quickstart.git
    
  • 启动Jupyter Lab

    cd openai-quickstart
    jupyter lab
    
  • 安装依赖包

    pip install tiktoken openai pandas matplotlib plotly scikit-learn numpy
    
  • Embedding模型关键参数
    https://platform.openai.com/docs/guides/embeddings/what-are-embeddings

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容