Full Code of 01-ai/Yi for AI

main f73194cc16e8 cached
126 files
3.2 MB
835.9k tokens
204 symbols
1 requests
Download .txt
Showing preview only (3,340K chars total). Download the full file or copy to clipboard to get everything.
Repository: 01-ai/Yi
Branch: main
Commit: f73194cc16e8
Files: 126
Total size: 3.2 MB

Directory structure:
gitextract_diif25g8/

├── .dockerignore
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── 1_bug-report.yml
│   │   ├── 2_feature-request.yml
│   │   ├── 3_documentation.yml
│   │   └── config.yml
│   └── workflows/
│       ├── basic_check.yml
│       ├── build_docker_image.yml
│       └── sync_files.yml
├── .gitignore
├── .pre-commit-config.yaml
├── Cookbook/
│   ├── CHANGELOG.md
│   ├── CONTRIBUTING.md
│   ├── CONTRIBUTING_cn.md
│   ├── README.md
│   ├── README_cn.md
│   ├── cn/
│   │   ├── api/
│   │   │   ├── function_calling/
│   │   │   │   └── function_calling_llamaindex.ipynb
│   │   │   └── rag/
│   │   │       ├── yi_rag_langchain.ipynb
│   │   │       └── yi_rag_llamaindex.ipynb
│   │   ├── ecosystem/
│   │   │   ├── yi-vl最佳实践.md
│   │   │   ├── 使用Yi大模型玩转街霸三.md
│   │   │   ├── 基于LlamaIndex和Yi-large构建智能问答系统.md
│   │   │   ├── 基于yi-large构建思维导图生成器.md
│   │   │   └── 强化Yi-1.5-6B-Chat的数学和逻辑能力.md
│   │   └── opensource/
│   │       ├── Inference/
│   │       │   ├── Inference_using_lmdeploy.ipynb
│   │       │   ├── Inference_using_swift.ipynb
│   │       │   ├── Inference_using_transformers.ipynb
│   │       │   └── vLLM_Inference_tutorial.ipynb
│   │       ├── fine_tune/
│   │       │   ├── finetune-yi-with-llamafactory.md
│   │       │   └── finetune-yi-with-swift.md
│   │       ├── function_calling/
│   │       │   ├── function_calling.ipynb
│   │       │   └── function_calling_llamaindex.ipynb
│   │       ├── local/
│   │       │   ├── local-llama.cpp.md
│   │       │   ├── local-lm-studio.md
│   │       │   ├── local-mlx.md
│   │       │   └── local-ollama.md
│   │       ├── quantization/
│   │       │   ├── autoawq-yi-quantization.md
│   │       │   ├── autogptq-yi-quantization.md
│   │       │   └── swift-yi-quantization.md
│   │       └── rag/
│   │           ├── yi_rag_langchain.ipynb
│   │           └── yi_rag_llamaindex.ipynb
│   └── en/
│       ├── api/
│       │   ├── function_calling/
│       │   │   └── function_calling_llamaindex.ipynb
│       │   └── rag/
│       │       ├── yi_rag_langchain.ipynb
│       │       └── yi_rag_llamaindex.ipynb
│       ├── ecosystem/
│       │   ├── Building_a_Mind_Map_Generator_Powered_by_Yi-Large.md
│       │   ├── Building_an_Intelligent_Q&A_System_Based_on_LlamaIndex_and_Yi-large.md
│       │   ├── Enhancing_the_Mathematical_and_Logical_Reasoning_Abilities_of_Yi-1.5-6B-Chat.md
│       │   ├── Mastering_Street_Fighter_III_with_the_Yi_Language_Model.md
│       │   └── yi-vl-best-practice.md
│       └── opensource/
│           ├── Inference/
│           │   ├── Inference_using_lmdeploy.ipynb
│           │   ├── Inference_using_swift.ipynb
│           │   ├── Inference_using_transformers.ipynb
│           │   └── vLLM_Inference_tutorial.ipynb
│           ├── fine_tune/
│           │   ├── finetune-yi-with-llamafactory.md
│           │   └── finetune-yi-with-swift.md
│           ├── function_calling/
│           │   ├── function_calling.ipynb
│           │   └── function_calling_llamaindex.ipynb
│           ├── local/
│           │   ├── local-llama.cpp.md
│           │   ├── local-lm-studio.md
│           │   ├── local-mlx.md
│           │   └── local-ollama.md
│           ├── quantization/
│           │   ├── autoawq-yi-quantization.md
│           │   ├── autogptq-yi-quantization.md
│           │   └── swift-yi-quantization.md
│           └── rag/
│               ├── yi_rag_langchain.ipynb
│               └── yi_rag_llamaindex.ipynb
├── Dockerfile
├── Events/
│   └── readme.md
├── HUGGINGFACE_README.md
├── LICENSE
├── MODEL_LICENSE_AGREEMENT.txt
├── NOTICE
├── README/
│   ├── huggingface_header.md
│   ├── modelscope_header.md
│   └── wisemodel_header.md
├── README.md
├── README_CN.md
├── VL/
│   ├── README.md
│   ├── cli.py
│   ├── llava/
│   │   ├── __init__.py
│   │   ├── conversation.py
│   │   ├── mm_utils.py
│   │   └── model/
│   │       ├── __init__.py
│   │       ├── clip_encoder/
│   │       │   ├── builder.py
│   │       │   └── clip_encoder.py
│   │       ├── constants.py
│   │       ├── llava_arch.py
│   │       ├── llava_llama.py
│   │       └── multimodal_projector/
│   │           └── builder.py
│   ├── openai_api.py
│   ├── requirements.txt
│   ├── single_inference.py
│   └── web_demo.py
├── assets/
│   └── img/
│       ├── coder/
│       │   └── test
│       └── events/
│           └── 1
├── conda-lock.yml
├── demo/
│   ├── README.md
│   ├── text_generation.py
│   ├── text_generation_tp.py
│   └── web_demo.py
├── docs/
│   └── README_llama.cpp.md
├── finetune/
│   ├── README.md
│   ├── README_CN.md
│   ├── constant.py
│   ├── scripts/
│   │   ├── run_eval.sh
│   │   ├── run_sft_Yi_34b.sh
│   │   ├── run_sft_Yi_6b.sh
│   │   └── run_sft_lora_Yi_6b.sh
│   ├── sft/
│   │   ├── main.py
│   │   └── prompt_eval.py
│   ├── utils/
│   │   ├── data/
│   │   │   ├── data_utils.py
│   │   │   └── raw_datasets.py
│   │   ├── ds_utils.py
│   │   ├── model/
│   │   │   └── model_utils.py
│   │   ├── module/
│   │   │   └── lora.py
│   │   ├── perf.py
│   │   └── utils.py
│   └── yi_example_dataset/
│       └── data/
│           ├── eval.jsonl
│           └── train.jsonl
├── pyproject.toml
├── quantization/
│   ├── awq/
│   │   ├── README.md
│   │   ├── eval_quantized_model.py
│   │   └── quant_autoawq.py
│   └── gptq/
│       ├── README.md
│       ├── eval_quantized_model.py
│       └── quant_autogptq.py
└── requirements.txt

================================================
FILE CONTENTS
================================================

================================================
FILE: .dockerignore
================================================
.git/
.venv/
venv/


================================================
FILE: .github/ISSUE_TEMPLATE/1_bug-report.yml
================================================
name: 🐞 Bug report
description: "Problems encountered while utilizing Yi model"
title: "Title "
labels: ["type/bug-report"]
body:
  - type: markdown
    attributes:
      value: |
        Thank you very much for your contribution!
  - type: checkboxes
    attributes:
      label: Reminder
      description: >
        Please search [Github Discussion](https://github.com/01-ai/Yi/discussions) and [issues](https://github.com/01-ai/Yi/issues) carefully.
      options:
        - label: >
            I have searched the Github Discussion and issues and have not found anything similar to this.
          required: true
  - type: textarea
    attributes:
      label: Environment
      description: |
        examples:
          - **OS**: Ubuntu 20.04
          - **Python**: 3.10
          - **PyTorch**: 2.0.1+cu118
          - **CUDA**: 11.8
      value: |
        - OS:
        - Python:
        - PyTorch:
        - CUDA:
      render: markdown
    validations:
      required: true
  - type: textarea
    attributes:
      label: Current Behavior
      description: |
        A concise description of what you're experiencing, with screenshot attached if possible.
    validations:
      required: true
  - type: textarea
    attributes:
      label: Expected Behavior
      description: A concise description of what you expected to happen.
    validations:
      required: false
  - type: textarea
    attributes:
      label: Steps to Reproduce
      description: Steps to reproduce the behavior.
      placeholder: |
        1. In this environment...
        2. With this config...
        3. Run '...'
        4. See error...
    validations:
      required: true
  - type: textarea
    attributes:
      label: Anything Else?
      description: |
        Links? References? Anything that will give us more context about the issue you are encountering!
    validations:
      required: false


================================================
FILE: .github/ISSUE_TEMPLATE/2_feature-request.yml
================================================
name: 🚀 Feature request
description: "Add new feature, improve code, and more"
title: "Features "
labels: ["type/feature-request"]
body:
  - type: markdown
    attributes:
      value: |
        Thank you very much for your contribution!
  - type: checkboxes
    attributes:
      label: Reminder
      description: >
        Please search [Github Discussion](https://github.com/01-ai/Yi/discussions) and [issues](https://github.com/01-ai/Yi/issues) carefully.
      options:
        - label: >
            I have searched the Github Discussion and issues and have not found anything similar to this.
          required: true
  - type: textarea
    attributes:
      label: Motivation
      description: Describe the motivations for this enhancement.
    validations:
      required: true
  - type: textarea
    attributes:
      label: Solution
      description: Describe the proposed solution and add related materials like links if any.
  - type: textarea
    attributes:
      label: Alternatives
      description: Describe other alternative solutions or features you considered, but rejected.
  - type: textarea
    attributes:
      label: Anything Else?
  - type: checkboxes
    attributes:
      label: Are you willing to submit a PR?
      description: >
        We look forward to your contribution to making Yi better. If you are willing to submit a PR to implement this enhancement, please check the box.
      options:
        - label: I'm willing to submit a PR!


================================================
FILE: .github/ISSUE_TEMPLATE/3_documentation.yml
================================================
name: 📚 Document
description: Suggest document changes
title: "Doc"
labels: ["doc-required"]
body:
  - type: markdown
    attributes:
      value: |
        Thank you very much for your contribution!
  - type: checkboxes
    attributes:
      label: Reminder
      description: >
        Please search [Github Discussion](https://github.com/01-ai/Yi/discussions) and [issues](https://github.com/01-ai/Yi/issues) carefully.
      options:
        - label: >
            I have searched the Github Discussion and issues and have not found anything similar to this.
          required: true
  - type: textarea
    attributes:
      label: What issue do you find in Yi docs?
      description: For example, something missing, inaccurate, incomplete, hard to use/understand/find, etc.
    validations:
      required: true
  - type: textarea
    attributes:
      label: What is your suggestion?
      description: For example, add explanations, correct descriptions, delete information, etc.
    validations:
      required: true
  - type: textarea
    attributes:
      label: Any reference?
      description: (For example, website links, etc)?
  - type: checkboxes
    attributes:
      label: Are you willing to submit a PR?
      description: >
        We look forward to your contribution to making Yi better. If you are willing to submit a PR, please check the box.
      options:
        - label: I'm willing to submit a PR!


================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false

contact_links:
  - name: 💬 Ask a question or get support
    url: https://github.com/01-ai/Yi/discussions
    about: Ask a question or request support for using Yi


================================================
FILE: .github/workflows/basic_check.yml
================================================
name: Basic Check

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  basic-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: "3.10"
      - name: Install linting libraries
        run: pip install autoflake isort black
      - name: Autoflake
        run: |
          output="$(autoflake . --remove-all-unused-imports --remove-unused-variables --expand-star-imports --ignore-init-module-imports -r)"
          if [[ -n $output ]]
          then
          printf "%s\n" "$output"
          exit 1
          else
          exit 0
          fi
      - name: Isort
        run: isort . --profile black --check-only --diff
      - name: Black
        run: black . --diff --color --check


================================================
FILE: .github/workflows/build_docker_image.yml
================================================
name: Build Docker Image

on:
  workflow_dispatch:
  push:
    tags:
      - '*.*.*'

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  authorize:
    environment:
      ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
    runs-on: oversea
    steps:
      - run: true

  build-docker-image:
    needs: authorize
    strategy:
      matrix:
        runner: [oversea] # remove public runner, 24-3-6
    runs-on: ${{ matrix.runner }}
    steps:
      - uses: actions/checkout@v4
      # try to create a tag
      - uses: SebRollen/toml-action@v1.0.2
        id: read_version
        with:
          file: "pyproject.toml"
          field: "tool.poetry.version"
      - uses: rickstaa/action-create-tag@v1
        id: "tag_create"
        if: (github.ref_name == github.event.repository.default_branch) && !contains(steps.read_version.outputs.value, '-')
        with:
          tag: ${{ steps.read_version.outputs.value }}
      # build & push docker image
      - name: Set proxy
        run: |
          echo "http_proxy=$http_proxy" >> $GITHUB_ENV
          echo "https_proxy=$https_proxy" >> $GITHUB_ENV
          echo "no_proxy=$no_proxy" >> $GITHUB_ENV
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3
        # with:
        #   driver-opts: |
        #     env.http_proxy=${{ env.http_proxy }}
        #     env.https_proxy=${{ env.http_proxy }}
        #   buildkitd-flags: --debug
      - name: Extract docker meta
        id: meta
        uses: docker/metadata-action@v5
        with:
          images: |
            ${{ matrix.runner == 'public' && format('{0}/ci/{1}', secrets.DEFAULT_REGISTRY, github.repository) || '' }}
            ${{ matrix.runner == 'public' && format('{0}/ci/{1}', secrets.PUBLIC_REGISTRY, github.repository) || '' }}
            ${{ matrix.runner == 'oversea' && format('ghcr.io/{0}', github.repository) || '' }}
          tags: |
            # set latest tag for default branch
            type=raw,value=latest,enable={{is_default_branch}}
            type=raw,value=${{ steps.read_version.outputs.value }},enable={{is_default_branch}}
            # pull request event
            type=ref,event=pr
      - name: Extract more docker meta
        id: more-meta
        shell: bash
        run: |
          PRIMARY_TAG=$(echo '${{ steps.meta.outputs.tags }}' | head -n 1)
          echo "PRIMARY_TAG=$PRIMARY_TAG" >> "$GITHUB_OUTPUT"
          echo "PRIMARY_TAG_SHORT=$(echo $PRIMARY_TAG | cut -d ':' -f1)" >> "$GITHUB_OUTPUT"
      - name: Login to default container registry
        if: matrix.runner == 'public'
        uses: docker/login-action@v2
        with:
          registry: ${{ secrets.DEFAULT_REGISTRY }}
          username: ${{ secrets.DEFAULT_REGISTRY_USER }}
          password: ${{ secrets.DEFAULT_REGISTRY_PASSWORD }}
      - name: Login to public container registry
        if: matrix.runner == 'public'
        uses: docker/login-action@v2
        with:
          registry: ${{ secrets.PUBLIC_REGISTRY }}
          username: ${{ secrets.PUBLIC_REGISTRY_USER }}
          password: ${{ secrets.PUBLIC_REGISTRY_PASSWORD }}
      - name: Login to ghcr.io
        if: matrix.runner == 'oversea'
        uses: docker/login-action@v2
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - name: Build and push
        id: build-image
        uses: docker/build-push-action@v5
        with:
          build-args: |
            REGISTRY=${{ matrix.runner == 'public' && format('{0}/ci', secrets.DEFAULT_REGISTRY) || 'nvcr.io'}}
            HTTP_PROXY=${{ env.http_proxy }}
            HTTPS_PROXY=${{ env.https_proxy }}
            NO_PROXY=${{ env.no_proxy }}
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
          cache-from: type=registry,ref=${{ steps.more-meta.outputs.PRIMARY_TAG_SHORT }}:buildcache
          cache-to: ${{ github.event_name == 'pull_request_target' && '' || format('type=registry,image-manifest=true,ref={0}:buildcache,mode=max', steps.more-meta.outputs.PRIMARY_TAG_SHORT) }}


================================================
FILE: .github/workflows/sync_files.yml
================================================
name: Sync Files

on:
  push:
    branches:
      - main

env:
  GIT_CLONE_PROTECTION_ACTIVE: false

jobs:
  detect-changes:
    runs-on: ubuntu-latest
    outputs:
      is_readme_changed: ${{ steps.changed-files.outputs.readme_any_changed }}
      is_license_changed: ${{ steps.changed-files.outputs.license_any_changed }}
    steps:
    - name: Checkout Repository
      uses: actions/checkout@v4
      with:
        fetch-depth: 0

    - name: Get changed files
      id: changed-files
      uses: tj-actions/changed-files@v41
      with:
        files_yaml: |
          readme:
            - README.md
            - README/**
          license:
            - MODEL_LICENSE_AGREEMENT.txt
  sync-readme:
    runs-on: ${{ matrix.platform == 'huggingface' && 'ubuntu-latest' || 'public' }}
    needs: detect-changes
    if: needs.detect-changes.outputs.is_readme_changed == 'true' || needs.detect-changes.outputs.is_license_changed == 'true'
    strategy:
      matrix:
        platform:
          - huggingface
          - modelscope
          - wisemodel
        repo:
          - Yi-6B
          - Yi-6B-200K
          - Yi-6B-Chat
          - Yi-6B-Chat-4bits
          - Yi-6B-Chat-8bits
          - Yi-9B
          - Yi-9B-200K
          - Yi-34B
          - Yi-34B-200K
          - Yi-34B-Chat
          - Yi-34B-Chat-4bits
          - Yi-34B-Chat-8bits
    steps:
      - uses: actions/checkout@v4
      - run: echo "REPO=${{ matrix.platform == 'huggingface' && format('https://{0}:{1}@huggingface.co/01-ai/{2}', secrets.HF_USER, secrets.HF_TOKEN, matrix.repo) || (matrix.platform == 'modelscope' && format('http://oauth2:{0}@www.modelscope.cn/01ai/{1}.git', secrets.MODELSCOPE_TOKEN, matrix.repo) || format('https://oauth2:{0}@www.wisemodel.cn/01.AI/{1}.git', secrets.WISEMODEL_TOKEN, matrix.repo))}}" >> $GITHUB_ENV
      - run: GIT_LFS_SKIP_SMUDGE=1 git clone ${{ env.REPO }}
      - if: needs.detect-changes.outputs.is_readme_changed == 'true' && matrix.platform == 'huggingface'
        run: |
          cat README/huggingface_header.md > ${{ matrix.repo }}/README.md
          csplit README.md '/<!-- DO NOT REMOVE ME -->/'
          cat xx01 >> ${{ matrix.repo }}/README.md
      - if: needs.detect-changes.outputs.is_readme_changed == 'true' && matrix.platform != 'huggingface'
        run: |
          cat README/${{matrix.platform}}_header.md > ${{ matrix.repo }}/README.md
          cat README.md >> ${{ matrix.repo }}/README.md
      - name: Sync LICENSE to ${{ matrix.platform }} ${{ matrix.repo }}
        if: needs.detect-changes.outputs.is_license_changed == 'true'
        run: |
          cat MODEL_LICENSE_AGREEMENT.txt > ${{ matrix.repo }}/LICENSE
      - run: |
          cd ${{ matrix.repo }}
          git config --global user.email "yi@01.ai"
          git config --global user.name "yi-01-ai"
          git add .
          git commit --dry-run || exit 0
          git commit -m "Auto Sync from ${{ github.repositoryUrl}}/commit/${{ github.sha}}"
          git push ${{ env.REPO }}


================================================
FILE: .gitignore
================================================
.idea/*
.vscode/*

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
#   For a library or package, you might want to ignore these files since the code is
#   intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
#   However, in case of collaboration, if having platform-specific dependencies or dependencies
#   having no cross-platform support, pipenv may install dependencies that don't work, or not
#   install all needed dependencies.
#Pipfile.lock

# poetry
#   Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
#   This is especially recommended for binary packages to ensure reproducibility, and is more
#   commonly ignored for libraries.
#   https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
#   Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
#   pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
#   in version control.
#   https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
#  JetBrains specific template is maintained in a separate JetBrains.gitignore that can
#  be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
#  and can be added to the global gitignore or merged into this file.  For a more nuclear
#  option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.DS_Store


================================================
FILE: .pre-commit-config.yaml
================================================
repos:
  - repo: https://github.com/psf/black
    rev: 23.7.0
    hooks:
      - id: black
        # It is recommended to specify the latest version of Python
        # supported by your project here, or alternatively use
        # pre-commit's default_language_version, see
        # https://pre-commit.com/#top_level-default_language_version
        language_version: python3.10
  - repo: https://github.com/pycqa/isort
    rev: 5.12.0
    hooks:
      - id: isort
        name: isort (python)
        args: ["--profile", "black", "--filter-files"]
  - repo: https://github.com/PyCQA/autoflake
    rev: v2.2.1
    hooks:
      - id: autoflake
        args: [--remove-all-unused-imports, --remove-unused-variables, --expand-star-imports, --ignore-init-module-imports, -r, --in-place]

================================================
FILE: Cookbook/CHANGELOG.md
================================================
```
记录版本变化 
```


================================================
FILE: Cookbook/CONTRIBUTING.md
================================================
# Contributing Guide

We appreciate your interest in contributing to our repository! To ensure a smooth and efficient process, please follow the guidelines below.

## Format

- **Notebook**: Jupyter Notebook (.ipynb)
- **Markdown**: Markdown file (.md)
  
## Guidelines

1. **Originality**: Ensure your content is original and not plagiarized.
2. **Non-promotional**: Avoid excessive marketing of your work.
3. **Submission Process**:
   - Submit your file and a description of your work.
   - Ensure your work can be reproduced based on your documentation.
   - If you encountered any issues during your experiments, try to include them in your documentation.
4. **Collaborative Development**: Aim to help and support fellow developers.

## How to Contribute

1. Fork the repository.
2. Create a new branch for your work.
3. Add your files in the appropriate format (ipynb or md).
4. Write clear and concise documentation to ensure reproducibility.
5. Submit a pull request with a detailed description of your work.

We look forward to your valuable contributions!



================================================
FILE: Cookbook/CONTRIBUTING_cn.md
================================================
# 贡献指南

感谢你对我们仓库的贡献兴趣!为确保流程顺利高效,请遵循以下指南。

## 格式

- **Notebook**:Jupyter Notebook (.ipynb)
- **Markdown**:Markdown 文件 (.md)
## 指南

1. **原创性**:确保你的内容是原创的,不得抄袭。
2. **非宣传性**:避免过度营销你的作品。
3. **提交流程**:
   - 提交你的文件和作品描述。
   - 确保你的作品可以根据你的文档复现。
   - 如果你在实验中遇到任何问题,请尽量将其包含在文档中。
4. **互助开发**:目标是帮助和支持其他开发者。

## 如何贡献

1. Fork 这个仓库。
2. 创建一个新分支来进行你的工作。
3. 添加你的文件,确保格式正确(ipynb 或 md)。
4. 撰写清晰简洁的文档以确保可复现性。
5. 提交一个详细描述你工作的 Pull Request。

我们期待你的宝贵贡献!


================================================
FILE: Cookbook/README.md
================================================
# 👋 Yi Cookbook

<p align="center">
  <a href="./README_cn.md">Chinese</a> | English
</p>

Welcome to the Yi Cookbook! This is your one-stop resource for everything related to Yi models, featuring tutorials, demos, and comprehensive documentation. Whether you're just starting out or looking to explore advanced use cases, you'll find valuable information here.


## News

- **🔥2024-08-09**: Yi Cookbook 1.0 is released, featuring tutorials and examples in both Chinese and English.


## OpenSource

| Category                    | Description                  | Notebook, Markdown                                                                                                                  | 
|:----------------------------|:-----------------------------|:--------------------------------------------------------------------------------------------------------------------------|
| inference, swift              | Perform efficient inference with the Yi model using Swift.    | [Inference_using_swift.ipynb](./en/opensource/Inference/Inference_using_swift.ipynb)                                      | 
| inference, transformers       | Utilize Transformers to rapidly run inference with the Yi model.  | [Inference_using_transformers.ipynb](./en/opensource/Inference/Inference_using_transformers.ipynb)                           |
| inference, Imdeploy           | Experience fast inference with the Yi model through Imdeploy.  | [Inference_using_lmdeploy.ipynb](./en/opensource/Inference/Inference_using_lmdeploy.ipynb)                                | 
| inference, vllm               | Deploy vllm for quick and efficient inference with the Yi model.       | [vLLM_Inference_tutorial.ipynb](./en/opensource/Inference/vLLM_Inference_tutorial.ipynb)                                  | 
| inference, skypilot | Run Yi with SkyPilot on Your Cloud. | [running_yi_with_skypilot.md](https://github.com/Haijian06/skypilot/tree/master/llm/yi)                    | 
| quantization, swift          | Learn how to quantize your Yi model using the power of Swift.         | [swift-yi-quantization.md](./en/opensource/quantization/swift-yi-quantization.md)                                           |
| quantization, autoawq        | Explore quantization techniques for the Yi model with autoawq.       | [autoawq-yi-quantization.md](./en/opensource/quantization/autoawq-yi-quantization.md)                                     | 
| quantization, autogptq       | Dive into quantizing the Yi model using the autogptq library.      | [autogptq-yi-quantization.md](./en/opensource/quantization/autogptq-yi-quantization.md)                                   | 
| fine-tuning, swift          | Discover how to fine-tune your own Yi model with Swift for personalized results.    | [finetune-yi-with-swift.md](./en/opensource/fine_tune/finetune-yi-with-swift.md)                                          |
| fine-tuning, LlaMA-Factory  | Unlock the potential of fine-tuning your Yi model with the versatile LlaMA-Factory.| [finetune-yi-with-llamafactory.md](./en/opensource/fine_tune/finetune-yi-with-llamafactory.md)                             | 
| Local Run, ollama           | Set up and run the Yi model locally using the convenient ollama framework.     | [local-ollama.md](./en/opensource/local/local-ollama.md)                                                                   | 
| Local Run, MLX-LM           | Explore local execution of the Yi model within the MLX-LM environment.      | [local-mlx.md](./en/opensource/local/local-mlx.md)                                                                       | 
| Local Run, LM Studio        | Get hands-on experience running the Yi model locally using the intuitive LM Studio interface.   | [local-lm-studio.md](./en/opensource/local/local-lm-studio.md)                                                              |
| Local Run, llama.cpp        | Leverage the llama.cpp library to run the Yi model on your local machine.   | [local-llama.cpp.md](./en/opensource/local/local-llama.cpp.md)                                                              | 
| RAG, LlamaIndex             | Delve into the world of RAG by building a system based on the Yi model and the powerful LlamaIndex library.| [yi_rag_llamaindex.ipynb](./en/opensource/rag/yi_rag_llamaindex.ipynb)                                                |
| RAG, LangChain              | Master the art of building robust RAG systems using LangChain as the backbone for your Yi model integration.                   | [yi_rag_langchain.ipynb](./en/opensource/rag/yi_rag_langchain.ipynb)                                                     | 
| function calling            | Embark on a journey to implement function calling from the ground up.      | [function_calling.ipynb](./en/opensource/function_calling/function_calling.ipynb)                                           |
| function calling, LlamaIndex | Discover the seamless integration of function calling with the Yi model and LlamaIndex. | [function_calling_llamaindex.ipynb](./en/opensource/function_calling/function_calling_llamaindex.ipynb)                    | 


## API

| Category                   | Description                      | Notebook, Markdown                                                                                               | 
|:---------------------------|:---------------------------------|:-------------------------------------------------------------------------------------------------------|
| RAG, LlamaIndex             | Integrate the Yi(api) model with LlamaIndex to build a powerful RAG system.| [yi_rag_llamaindex.ipynb](./en/api/rag/yi_rag_llamaindex.ipynb)                                     |
| RAG, LangChain              | Explore building feature-rich RAG applications by harnessing the capabilities of LangChain with the Yi API.              | [yi_rag_langchain.ipynb](./en/api/rag/yi_rag_langchain.ipynb)                                         |
| function calling, LlamaIndex | Learn how to effortlessly implement function calling using the Yi model, powered by the intuitive LlamaIndex framework.     | [function_calling_llamaindex.ipynb](./en/api/function_calling/function_calling_llamaindex.ipynb)     | 

## Ecosystem

| Category    | Description                   | Notebook, Markdown                                                                                                                                                                                                 | 
|:------------|:------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| fine-tuning | Unlock enhanced mathematical and logical abilities by fine-tuning the Yi-1.5-6B-Chat open-source model.  | [Enhancing the mathematical and logical abilities of Yi-1.5-6B-Chat.md](./en/ecosystem/Enhancing_the_Mathematical_and_Logical_Reasoning_Abilities_of_Yi-1.5-6B-Chat.md)                                           |
| RAG         | Construct an intelligent question answering system by combining the strengths of LlamaIndex and the Yi-large model. | [Building an Intelligent Question Answering System Based on LlamaIndex and Yi-large.md](./en/ecosystem/Building_an_Intelligent_Q&A_System_Based_on_LlamaIndex_and_Yi-large.md)                                    | 
| demo        | Witness the capabilities of large models beyond traditional tasks with a demonstration of Yi playing Street Fighter III.             | [Playing Street Fighter III with Yi large model.md](./en/ecosystem/Mastering_Street_Fighter_III_with_the_Yi_Language_Model.md)                                                                                    |
| demo        | Explore the creative potential of Yi by diving into a mind map generator application.                        | [Building a Mind Map Generator Based on yi-large.md](./en/ecosystem/Building_a_Mind_Map_Generator_Powered_by_Yi-Large.md)                                                                                         | 
| fine-tuning | Maximize your fine-tuning efforts with a comprehensive guide to best practices for the yi-vl model.                 | [Best Practices for yi-vl Fine-tuning.md](./en/ecosystem/yi-vl-best-practice.md)                                                                                                                                  | 

## Community Contributions

We warmly welcome contributions from the community! Here are some ways you can get involved:

- **Report Issues**: Discover a bug or have a feature suggestion? Please submit it to [GitHub Issues](https://github.com/01-ai/Yi/issues).
- **Contribute Demo**: Pull requests are highly appreciated! Please follow our [Contribution Guidelines](./CONTRIBUTING.md).


================================================
FILE: Cookbook/README_cn.md
================================================
# 👋 Yi Cookbook

<p align="center">
  <a href="./README.md">English</a> | 中文
</p>

欢迎来到 Yi Cookbook!这是一个关于 Yi 模型的综合资源库,包含教程、演示和详细文档。无论您是初学者还是想要研究模型的高阶使用,这里都能找到有价值的信息。

## 最新动态
- **🔥2024-08-09**: 发布 Yi Cookbook 英文版本
- **🔥2024-07-29**: 发布 Yi Cookbook 1.0 版本,包含中文教程和示例。

## OpenSource

| Category                    | Description                                  | Notebook, Markdown                                                                                                | 
|:----------------------------|:---------------------------------------------|:--------------------------------------------------------------------------------------------------------|
| inference, swift              | 利用 Swift 快速进行 Yi 模型推理。            | [Inference_using_swift.ipynb](./cn/opensource/Inference/Inference_using_swift.ipynb)                    | 
| inference, transformers       | 使用 Transformers 高效推理 Yi 模型。         | [Inference_using_transformers.ipynb](./cn/opensource/Inference/Inference_using_transformers.ipynb)      |
| inference, Imdeploy           | 通过 Imdeploy 快速上手 Yi 模型推理。         | [Inference_using_lmdeploy.ipynb](./cn/opensource/Inference/Inference_using_lmdeploy.ipynb)              | 
| inference, vllm               | 使用 vllm 体验 Yi 模型的快速推理。           | [vLLM_Inference_tutorial.ipynb](./cn/opensource/Inference/vLLM_Inference_tutorial.ipynb)                |
| skypilot | 通过 SkyPilot 在你的云端高效推理 Yi 模型。| [Running_yi_with_skyPilot.md](https://github.com/Haijian06/skypilot/tree/master/llm/yi)                    | 
| quantization, swift          | 使用 Swift轻松量化您的专属 Yi 模型。        | [swift-yi-quantization.md](./cn/opensource/quantization/swift-yi-quantization.md)                       |
| quantization, autoawq        | 利用 autoawq 量化您的 Yi 模型。              | [autoawq-yi-quantization.md](./cn/opensource/quantization/autoawq-yi-quantization.md)                   | 
| quantization, autogptq       | 使用 autogptq 对 Yi 模型进行量化。           | [autogptq-yi-quantization.md](./cn/opensource/quantization/autogptq-yi-quantization.md)                 | 
| fine-tuning, swift          | 使用 Swift 微调,打造您的个性化 Yi 模型。     | [finetune-yi-with-swift.md](./cn/opensource/fine_tune/finetune-yi-with-swift.md)                        |
| fine-tuning, LlaMA-Factory  | 使用 LlaMA-Factory 灵活微调您的 Yi 模型。 | [finetune-yi-with-llamafactory.md](./cn/opensource/fine_tune/finetune-yi-with-llamafactory.md)          | 
| Local Run, ollama           | 使用 ollama 在本地环境中运行 Yi 模型。     | [local-ollama.md](./cn/opensource/local/local-ollama.md)                                                | 
| Local Run, MLX-LM           | 在 MLX-LM 环境下本地运行 Yi 模型。           | [local-mlx.md](./cn/opensource/local/local-mlx.md)                                                      | 
| Local Run, LM Studio        | 使用 LM Studio 轻松本地运行 Yi 模型。         | [local-lm-studio.md](./cn/opensource/local/local-lm-studio.md)                                          |
| Local Run, llama.cpp        | 使用 llama.cpp 在本地运行 Yi 模型。         | [local-llama.cpp.md](./cn/opensource/local/local-llama.cpp.md)                                          | 
| RAG, LlamaIndex             | 基于 Yi 模型和 LlamaIndex 构建强大的 RAG 系统。| [yi_rag_llamaindex.ipynb](./cn/opensource/rag/yi_rag_llamaindex.ipynb)                                  |
| RAG, LangChain              | 使用 LangChain 构建灵活的 RAG 系统。        | [yi_rag_langchain.ipynb](./cn/opensource/rag/yi_rag_langchain.ipynb)                                    | 
| function calling            | 从零开始,实现函数调用。                     | [function_calling.ipynb](./cn/opensource/function_calling/function_calling.ipynb)                       |
| function calling, LlamaIndex | 基于 LlamaIndex,轻松实现函数调用。         | [function_calling_llamaindex.ipynb](./cn/opensource/function_calling/function_calling_llamaindex.ipynb) | 


## API

| Category                   | Description                      | Notebook, Markdown                                                                                         | 
|:---------------------------|:---------------------------------|:-------------------------------------------------------------------------------------------------|
| RAG, LlamaIndex             | 使用 Yi(api) 模型与 LlamaIndex 构建 RAG 应用。 | [yi_rag_llamaindex.ipynb](./cn/api/rag/yi_rag_llamaindex.ipynb)                                  |
| RAG, angChain              | 利用 LangChain,构建基于 Yi API 的 RAG 系统。| [yi_rag_langchain.ipynb](./cn/api/rag/yi_rag_langchain.ipynb)                                    |
| function calling, LlamaIndex | 使用 Yi 模型,基于 LlamaIndex 实现函数调用。   | [function_calling_llamaindex.ipynb](./cn/api/function_calling/function_calling_llamaindex.ipynb) | 

## Ecosystem

| Category    | Description                           | Notebook, Markdown                                                                                         | 
|:------------|:-----------------------------------------------|:-------------------------------------------------------------------------------------------------|
| fine-tuning | 强化 Yi-1.5-6B-Chat 开源模型的数学与逻辑能力。   | [强化Yi-1.5-6B-Chat的数学和逻辑能力.md](./cn/ecosystem/强化Yi-1.5-6B-Chat的数学和逻辑能力.md)                            |
| RAG         | 基于 LlamaIndex 和 Yi-large 构建智能问答系统。 | [基于LlamaIndex和Yi-large构建智能问答系统.md](./cn/ecosystem/基于LlamaIndex和Yi-large构建智能问答系统.md)                                  | 
| demo        | 大模型玩游戏?探索 Yi 玩转街霸三的奥秘!         | [使用Yi大模型玩转街霸三.md](./cn/ecosystem/使用Yi大模型玩转街霸三.md)                                    |
| demo        | 基于 yi-large,打造高效的思维导图生成器。      | [基于yi-large构建思维导图生成器.md](./cn/ecosystem/基于yi-large构建思维导图生成器.md) | 
| fine-tuning | 掌握 yi-vl 微调的最佳实践,事半功倍。         | [yi-vl最佳实践.md](./cn/ecosystem/yi-vl最佳实践.md)                                    |
## 社区贡献

我们热烈欢迎社区贡献!以下是参与方式:

- **问题报告**:发现 bug 或有功能建议?请在 [GitHub Issues](https://github.com/01-ai/Yi/issues) 提交。
- **展示你的作品!**:如果你有基于Yi模型做的有趣的、实用的应用或者教学,我们非常欢迎你提交PR到我们的仓库!请遵循我们的 [贡献指南](./CONTRIBUTING_cn.md)。


================================================
FILE: Cookbook/cn/api/function_calling/function_calling_llamaindex.ipynb
================================================
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyPi5Ho7I9ICMU0Jnn+/aVjA"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"markdown","source":["## Function Calling\n","\n","大模型使用Function Calling的主要用途是扩展模型的功能,使其能够在生成文本、做出决策或执行任务时,集成更广泛的信息和功能。通过定义和调用外部函数,大模型能够处理更复杂的任务,如进行数学运算、下订单或查询数据库等,从而提高模型的实用性和灵活性。\n"],"metadata":{"id":"tY2fLItjnn6U"}},{"cell_type":"markdown","source":["### 🌟使用LlamaIndex\n","\n","LlamaIndex 开发了简单易用的 Function Calling 使用方法,接下来我们使用yi-large进行一个示例\n","\n","首先安装依赖环境,跟着我一步一步来!\n"],"metadata":{"id":"EiQrQO8In5W2"}},{"cell_type":"code","source":["!pip install llama-index\n","!pip install llama-index-llms-huggingface\n","!pip install llama-index-llms-yi"],"metadata":{"id":"9-f7jfstpCEe"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["确保你安装完成后我们就开始吧\n","\n","加载依赖"],"metadata":{"id":"3tlgHR5spMhG"}},{"cell_type":"code","execution_count":3,"metadata":{"id":"w9F41myGnfCS","executionInfo":{"status":"ok","timestamp":1721973909886,"user_tz":-480,"elapsed":8874,"user":{"displayName":"haijian wang","userId":"16545674694152900117"}}},"outputs":[],"source":["from typing import Any\n","\n","\n","from llama_index.core.llms import (\n","    CustomLLM,\n","    CompletionResponse,\n","    CompletionResponseGen,\n","    LLMMetadata,\n",")\n","from llama_index.core.llms.callbacks import llm_completion_callback\n","from llama_index.llms.yi import Yi\n","\n","from llama_index.core.tools import FunctionTool\n","from llama_index.core.agent import ReActAgent"]},{"cell_type":"markdown","source":["配置模型,需要前往零一万物[开放平台](https://platform.lingyiwanwu.com/apikeys)申请api_key"],"metadata":{"id":"xBu4fAuapTMS"}},{"cell_type":"code","source":["llm = Yi(model=\"yi-large\", api_key=\"your_api_key\")"],"metadata":{"id":"Lq4QFDl-pLn_"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["定义工具,这里我们定义 `加` `减` `乘` 的三种函数"],"metadata":{"id":"gCnRQ2vNpViR"}},{"cell_type":"code","source":["# 定义工具\n","def multiply(a: int, b: int) -> int:\n","    \"\"\"Multiple two integers and returns the result integer\"\"\"\n","    return a * b\n","\n","def plus(a: int, b: int) -> int:\n","    \"\"\"plus two integers and returns the result integer\"\"\"\n","    return a + b\n","def minus(a: int, b: int) -> int:\n","    \"\"\"Subtracts two integers and returns the result integer.\"\"\"\n","    return a - b\n","multiply_tool = FunctionTool.from_defaults(fn=multiply)\n","plus_tool = FunctionTool.from_defaults(fn=plus)\n","minus_tool = FunctionTool.from_defaults(fn=minus)"],"metadata":{"id":"g5-zAq22pXu6"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["创建Agent"],"metadata":{"id":"cvUFnsAkph-O"}},{"cell_type":"code","source":["agent = ReActAgent.from_tools([multiply_tool,plus_tool,minus_tool], llm=llm, verbose=True)"],"metadata":{"id":"Hurvg2J1pjQB"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["确保运行正确后我们就开始对话"],"metadata":{"id":"kEkZMzaXplsK"}},{"cell_type":"code","source":["while True:\n","    user_input = input(\"user>>\") # \"(1+2)*10\"\n","    agent.chat(user_input)"],"metadata":{"id":"Ki3NKbq_pqTz"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["运行结果展示"],"metadata":{"id":"HjcL_f7npr-K"}},{"cell_type":"markdown","source":["``````\n","user>>(1+2)*10\n","Thought: The user's question is in English. I need to use a combination of the 'plus' and 'multiply' tools to solve the mathematical expression (1+2)*10.\n","Action: plus\n","Action Input: {'a': 1, 'b': 2}\n","Observation: 3\n","Thought: I have the result of the 'plus' operation, which is 3. Now I need to multiply this result by 10 to complete the expression (1+2)*10.\n","Action: multiply\n","Action Input: {'a': 3, 'b': 10}\n","Observation: 30\n","Thought: I have the result of the 'multiply' operation, which is 30. This is the final result of the expression (1+2)*10.\n","Thought: I can answer without using any more tools. I'll use the user's language to answer.\n","Answer: The result of the expression (1+2)*10 is 30.\n","``````"],"metadata":{"id":"oBUz2VtkpuUw"}}]}

================================================
FILE: Cookbook/cn/api/rag/yi_rag_langchain.ipynb
================================================
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 使用Yi的API构建RAG(LangChain)\n",
    "\n",
    "在本教程中,我们将学习如何使用LangChain和Yi的API构建一个RAG(Retrieval-Augmented Generation)系统。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 安装必要的库\n",
    "\n",
    "首先,我们需要安装LangChain库。"
   ]
  },
  {
   "cell_type": "code",
   "metadata": {},
   "source": [
    "!pip install langchain"
   ],
   "execution_count": null,
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 配置环境变量\n",
    "\n",
    "接下来,我们需要配置LangSmith和Yi的API密钥。请确保您已经在[LangSmith](https://smith.langchain.com/)和零一万物[开放平台](https://platform.lingyiwanwu.com/apikeys)注册并获取了API密钥。"
   ]
  },
  {
   "cell_type": "code",
   "metadata": {},
   "source": [
    "import getpass\n",
    "import os\n",
    "\n",
    "os.environ[\"LANGCHAIN_TRACING_V2\"] = \"true\"\n",
    "os.environ[\"LANGCHAIN_API_KEY\"] = \"your_langsmith_api_key\"\n",
    "os.environ[\"YI_API_KEY\"] = \"your_yi_api_key\""
   ],
   "execution_count": null,
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 安装LangChain-OpenAI库\n",
    "\n",
    "我们还需要安装`langchain-openai`库。"
   ]
  },
  {
   "cell_type": "code",
   "metadata": {},
   "source": [
    "!pip install -qU langchain-openai"
   ],
   "execution_count": null,
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 配置LLM\n",
    "\n",
    "现在我们来配置LLM,使用Yi的大型语言模型。"
   ]
  },
  {
   "cell_type": "code",
   "metadata": {},
   "source": [
    "from langchain_openai import ChatOpenAI\n",
    "\n",
    "llm = ChatOpenAI(\n",
    "    base_url=\"https://api.lingyiwanwu.com/v1\",\n",
    "    api_key=os.environ[\"YI_API_KEY\"],\n",
    "    model=\"yi-large\",\n",
    ")"
   ],
   "execution_count": null,
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 加载数据\n",
    "\n",
    "接下来我们将加载一些示例数据。这里我们使用了LangChain的WebBaseLoader来加载网页数据。"
   ]
  },
  {
   "cell_type": "code",
   "metadata": {},
   "source": [
    "import bs4\n",
    "from langchain_community.document_loaders import WebBaseLoader\n",
    "\n",
    "loader = WebBaseLoader(\n",
    "    web_paths=(\"https://lilianweng.github.io/posts/2023-06-23-agent/\",),\n",
    "    bs_kwargs=dict(\n",
    "        parse_only=bs4.SoupStrainer(\n",
    "            class_=(\"post-content\", \"post-title\", \"post-header\")\n",
    "        )\n",
    "    ),\n",
    ")\n",
    "docs = loader.load()"
   ],
   "execution_count": null,
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 构建向量数据库\n",
    "\n",
    "我们将使用HuggingFace的嵌入模型来构建向量数据库,并使用Chroma来存储向量。"
   ]
  },
  {
   "cell_type": "code",
   "metadata": {},
   "source": [
    "from langchain.embeddings import HuggingFaceEmbeddings\n",
    "from langchain_chroma import Chroma\n",
    "from langchain_text_splitters import RecursiveCharacterTextSplitter\n",
    "\n",
    "# 加载向量模型\n",
    "embedding = HuggingFaceEmbeddings(model_name=\"BAAI/bge-base-en-v1.5\")\n",
    "\n",
    "# 切分文档\n",
    "text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)\n",
    "splits = text_splitter.split_documents(docs)\n",
    "\n",
    "# 构建向量数据库\n",
    "vectorstore = Chroma.from_documents(documents=splits, embedding=embedding)\n",
    "retriever = vectorstore.as_retriever()"
   ],
   "execution_count": null,
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 构建RAG链\n",
    "\n",
    "最后,我们将构建RAG链,并使用LangChain的hub来获取提示。"
   ]
  },
  {
   "cell_type": "code",
   "metadata": {},
   "source": [
    "from langchain import hub\n",
    "from langchain_core.output_parsers import StrOutputParser\n",
    "from langchain_core.runnables import RunnablePassthrough\n",
    "\n",
    "prompt = hub.pull(\"rlm/rag-prompt\")\n",
    "\n",
    "def format_docs(docs):\n",
    "    return \"\\n\\n\".join(doc.page_content for doc in docs)\n",
    "\n",
    "rag_chain = (\n",
    "    {\"context\": retriever | format_docs, \"question\": RunnablePassthrough()}\n",
    "    | prompt\n",
    "    | llm\n",
    "    | StrOutputParser()\n",
    ")\n",
    "\n",
    "response = rag_chain.invoke(\"What is Task Decomposition?\")\n",
    "print(response)"
   ],
   "execution_count": null,
   "outputs": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "name": "python",
   "version": "3.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}


================================================
FILE: Cookbook/cn/api/rag/yi_rag_llamaindex.ipynb
================================================
{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "SweINiRd8dLd"
      },
      "source": [
        "# 使用Yi的API构建RAG (使用LlamaIndex)\n",
        "\n",
        "`LlamaIndex`是一个灵活的框架,用于构建基于LLM的应用程序,提供数据连接器、数据结构化工具和高级检索/查询接口。\n",
        "\n",
        "\n",
        "在本次示例中我们使用`bge-base-zh-v1.5`进行演示,这个模型主要用于检索中文。你也可以选择`bge-base-en-v1.5`模型来检索英文文档。\n"
      ],
      "id": "SweINiRd8dLd"
    },
    {
      "cell_type": "code",
      "execution_count": 3,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "6989tVXX8dLh",
        "outputId": "ccdd7497-7132-4eeb-fe89-6cab8d3d9e9c"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Requirement already satisfied: llama-index in /usr/local/lib/python3.10/dist-packages (0.10.58)\n",
            "Requirement already satisfied: llama-index-agent-openai<0.3.0,>=0.1.4 in /usr/local/lib/python3.10/dist-packages (from llama-index) (0.2.9)\n",
            "Requirement already satisfied: llama-index-cli<0.2.0,>=0.1.2 in /usr/local/lib/python3.10/dist-packages (from llama-index) (0.1.13)\n",
            "Requirement already satisfied: llama-index-core==0.10.58 in /usr/local/lib/python3.10/dist-packages (from llama-index) (0.10.58)\n",
            "Requirement already satisfied: llama-index-embeddings-openai<0.2.0,>=0.1.5 in /usr/local/lib/python3.10/dist-packages (from llama-index) (0.1.11)\n",
            "Requirement already satisfied: llama-index-indices-managed-llama-cloud>=0.2.0 in /usr/local/lib/python3.10/dist-packages (from llama-index) (0.2.7)\n",
            "Requirement already satisfied: llama-index-legacy<0.10.0,>=0.9.48 in /usr/local/lib/python3.10/dist-packages (from llama-index) (0.9.48)\n",
            "Requirement already satisfied: llama-index-llms-openai<0.2.0,>=0.1.27 in /usr/local/lib/python3.10/dist-packages (from llama-index) (0.1.27)\n",
            "Requirement already satisfied: llama-index-multi-modal-llms-openai<0.2.0,>=0.1.3 in /usr/local/lib/python3.10/dist-packages (from llama-index) (0.1.8)\n",
            "Requirement already satisfied: llama-index-program-openai<0.2.0,>=0.1.3 in /usr/local/lib/python3.10/dist-packages (from llama-index) (0.1.7)\n",
            "Requirement already satisfied: llama-index-question-gen-openai<0.2.0,>=0.1.2 in /usr/local/lib/python3.10/dist-packages (from llama-index) (0.1.3)\n",
            "Requirement already satisfied: llama-index-readers-file<0.2.0,>=0.1.4 in /usr/local/lib/python3.10/dist-packages (from llama-index) (0.1.31)\n",
            "Requirement already satisfied: llama-index-readers-llama-parse>=0.1.2 in /usr/local/lib/python3.10/dist-packages (from llama-index) (0.1.6)\n",
            "Requirement already satisfied: PyYAML>=6.0.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (6.0.1)\n",
            "Requirement already satisfied: SQLAlchemy>=1.4.49 in /usr/local/lib/python3.10/dist-packages (from SQLAlchemy[asyncio]>=1.4.49->llama-index-core==0.10.58->llama-index) (2.0.31)\n",
            "Requirement already satisfied: aiohttp<4.0.0,>=3.8.6 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (3.9.5)\n",
            "Requirement already satisfied: dataclasses-json in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (0.6.7)\n",
            "Requirement already satisfied: deprecated>=1.2.9.3 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (1.2.14)\n",
            "Requirement already satisfied: dirtyjson<2.0.0,>=1.0.8 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (1.0.8)\n",
            "Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (2023.6.0)\n",
            "Requirement already satisfied: httpx in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (0.27.0)\n",
            "Requirement already satisfied: nest-asyncio<2.0.0,>=1.5.8 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (1.6.0)\n",
            "Requirement already satisfied: networkx>=3.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (3.3)\n",
            "Requirement already satisfied: nltk<4.0.0,>=3.8.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (3.8.1)\n",
            "Requirement already satisfied: numpy<2.0.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (1.25.2)\n",
            "Requirement already satisfied: openai>=1.1.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (1.37.1)\n",
            "Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (2.0.3)\n",
            "Requirement already satisfied: pillow>=9.0.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (9.4.0)\n",
            "Requirement already satisfied: requests>=2.31.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (2.31.0)\n",
            "Requirement already satisfied: tenacity!=8.4.0,<9.0.0,>=8.2.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (8.5.0)\n",
            "Requirement already satisfied: tiktoken>=0.3.3 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (0.7.0)\n",
            "Requirement already satisfied: tqdm<5.0.0,>=4.66.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (4.66.4)\n",
            "Requirement already satisfied: typing-extensions>=4.5.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (4.12.2)\n",
            "Requirement already satisfied: typing-inspect>=0.8.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (0.9.0)\n",
            "Requirement already satisfied: wrapt in /usr/local/lib/python3.10/dist-packages (from llama-index-core==0.10.58->llama-index) (1.14.1)\n",
            "Requirement already satisfied: llama-cloud>=0.0.11 in /usr/local/lib/python3.10/dist-packages (from llama-index-indices-managed-llama-cloud>=0.2.0->llama-index) (0.0.11)\n",
            "Requirement already satisfied: beautifulsoup4<5.0.0,>=4.12.3 in /usr/local/lib/python3.10/dist-packages (from llama-index-readers-file<0.2.0,>=0.1.4->llama-index) (4.12.3)\n",
            "Requirement already satisfied: pypdf<5.0.0,>=4.0.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-readers-file<0.2.0,>=0.1.4->llama-index) (4.3.1)\n",
            "Requirement already satisfied: striprtf<0.0.27,>=0.0.26 in /usr/local/lib/python3.10/dist-packages (from llama-index-readers-file<0.2.0,>=0.1.4->llama-index) (0.0.26)\n",
            "Requirement already satisfied: llama-parse>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-readers-llama-parse>=0.1.2->llama-index) (0.4.9)\n",
            "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core==0.10.58->llama-index) (1.3.1)\n",
            "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core==0.10.58->llama-index) (23.2.0)\n",
            "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core==0.10.58->llama-index) (1.4.1)\n",
            "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core==0.10.58->llama-index) (6.0.5)\n",
            "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core==0.10.58->llama-index) (1.9.4)\n",
            "Requirement already satisfied: async-timeout<5.0,>=4.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core==0.10.58->llama-index) (4.0.3)\n",
            "Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.10/dist-packages (from beautifulsoup4<5.0.0,>=4.12.3->llama-index-readers-file<0.2.0,>=0.1.4->llama-index) (2.5)\n",
            "Requirement already satisfied: pydantic>=1.10 in /usr/local/lib/python3.10/dist-packages (from llama-cloud>=0.0.11->llama-index-indices-managed-llama-cloud>=0.2.0->llama-index) (2.8.2)\n",
            "Requirement already satisfied: anyio in /usr/local/lib/python3.10/dist-packages (from httpx->llama-index-core==0.10.58->llama-index) (3.7.1)\n",
            "Requirement already satisfied: certifi in /usr/local/lib/python3.10/dist-packages (from httpx->llama-index-core==0.10.58->llama-index) (2024.7.4)\n",
            "Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.10/dist-packages (from httpx->llama-index-core==0.10.58->llama-index) (1.0.5)\n",
            "Requirement already satisfied: idna in /usr/local/lib/python3.10/dist-packages (from httpx->llama-index-core==0.10.58->llama-index) (3.7)\n",
            "Requirement already satisfied: sniffio in /usr/local/lib/python3.10/dist-packages (from httpx->llama-index-core==0.10.58->llama-index) (1.3.1)\n",
            "Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.10/dist-packages (from httpcore==1.*->httpx->llama-index-core==0.10.58->llama-index) (0.14.0)\n",
            "Requirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from nltk<4.0.0,>=3.8.1->llama-index-core==0.10.58->llama-index) (8.1.7)\n",
            "Requirement already satisfied: joblib in /usr/local/lib/python3.10/dist-packages (from nltk<4.0.0,>=3.8.1->llama-index-core==0.10.58->llama-index) (1.4.2)\n",
            "Requirement already satisfied: regex>=2021.8.3 in /usr/local/lib/python3.10/dist-packages (from nltk<4.0.0,>=3.8.1->llama-index-core==0.10.58->llama-index) (2024.5.15)\n",
            "Requirement already satisfied: distro<2,>=1.7.0 in /usr/lib/python3/dist-packages (from openai>=1.1.0->llama-index-core==0.10.58->llama-index) (1.7.0)\n",
            "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.31.0->llama-index-core==0.10.58->llama-index) (3.3.2)\n",
            "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.31.0->llama-index-core==0.10.58->llama-index) (2.0.7)\n",
            "Requirement already satisfied: greenlet!=0.4.17 in /usr/local/lib/python3.10/dist-packages (from SQLAlchemy>=1.4.49->SQLAlchemy[asyncio]>=1.4.49->llama-index-core==0.10.58->llama-index) (3.0.3)\n",
            "Requirement already satisfied: mypy-extensions>=0.3.0 in /usr/local/lib/python3.10/dist-packages (from typing-inspect>=0.8.0->llama-index-core==0.10.58->llama-index) (1.0.0)\n",
            "Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in /usr/local/lib/python3.10/dist-packages (from dataclasses-json->llama-index-core==0.10.58->llama-index) (3.21.3)\n",
            "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from pandas->llama-index-core==0.10.58->llama-index) (2.8.2)\n",
            "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->llama-index-core==0.10.58->llama-index) (2023.4)\n",
            "Requirement already satisfied: tzdata>=2022.1 in /usr/local/lib/python3.10/dist-packages (from pandas->llama-index-core==0.10.58->llama-index) (2024.1)\n",
            "Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from anyio->httpx->llama-index-core==0.10.58->llama-index) (1.2.2)\n",
            "Requirement already satisfied: packaging>=17.0 in /usr/local/lib/python3.10/dist-packages (from marshmallow<4.0.0,>=3.18.0->dataclasses-json->llama-index-core==0.10.58->llama-index) (24.1)\n",
            "Requirement already satisfied: annotated-types>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from pydantic>=1.10->llama-cloud>=0.0.11->llama-index-indices-managed-llama-cloud>=0.2.0->llama-index) (0.7.0)\n",
            "Requirement already satisfied: pydantic-core==2.20.1 in /usr/local/lib/python3.10/dist-packages (from pydantic>=1.10->llama-cloud>=0.0.11->llama-index-indices-managed-llama-cloud>=0.2.0->llama-index) (2.20.1)\n",
            "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.2->pandas->llama-index-core==0.10.58->llama-index) (1.16.0)\n",
            "Requirement already satisfied: llama-index-llms-huggingface in /usr/local/lib/python3.10/dist-packages (0.2.5)\n",
            "Requirement already satisfied: huggingface-hub<0.24.0,>=0.23.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-llms-huggingface) (0.23.5)\n",
            "Requirement already satisfied: llama-index-core<0.11.0,>=0.10.57 in /usr/local/lib/python3.10/dist-packages (from llama-index-llms-huggingface) (0.10.58)\n",
            "Requirement already satisfied: text-generation<0.8.0,>=0.7.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-llms-huggingface) (0.7.0)\n",
            "Requirement already satisfied: torch<3.0.0,>=2.1.2 in /usr/local/lib/python3.10/dist-packages (from llama-index-llms-huggingface) (2.3.1+cu121)\n",
            "Requirement already satisfied: transformers<5.0.0,>=4.37.0 in /usr/local/lib/python3.10/dist-packages (from transformers[torch]<5.0.0,>=4.37.0->llama-index-llms-huggingface) (4.42.4)\n",
            "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<0.24.0,>=0.23.0->llama-index-llms-huggingface) (3.15.4)\n",
            "Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<0.24.0,>=0.23.0->llama-index-llms-huggingface) (2023.6.0)\n",
            "Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<0.24.0,>=0.23.0->llama-index-llms-huggingface) (24.1)\n",
            "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<0.24.0,>=0.23.0->llama-index-llms-huggingface) (6.0.1)\n",
            "Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<0.24.0,>=0.23.0->llama-index-llms-huggingface) (2.31.0)\n",
            "Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<0.24.0,>=0.23.0->llama-index-llms-huggingface) (4.66.4)\n",
            "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<0.24.0,>=0.23.0->llama-index-llms-huggingface) (4.12.2)\n",
            "Requirement already satisfied: SQLAlchemy>=1.4.49 in /usr/local/lib/python3.10/dist-packages (from SQLAlchemy[asyncio]>=1.4.49->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (2.0.31)\n",
            "Requirement already satisfied: aiohttp<4.0.0,>=3.8.6 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (3.9.5)\n",
            "Requirement already satisfied: dataclasses-json in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (0.6.7)\n",
            "Requirement already satisfied: deprecated>=1.2.9.3 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (1.2.14)\n",
            "Requirement already satisfied: dirtyjson<2.0.0,>=1.0.8 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (1.0.8)\n",
            "Requirement already satisfied: httpx in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (0.27.0)\n",
            "Requirement already satisfied: nest-asyncio<2.0.0,>=1.5.8 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (1.6.0)\n",
            "Requirement already satisfied: networkx>=3.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (3.3)\n",
            "Requirement already satisfied: nltk<4.0.0,>=3.8.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (3.8.1)\n",
            "Requirement already satisfied: numpy<2.0.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (1.25.2)\n",
            "Requirement already satisfied: openai>=1.1.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (1.37.1)\n",
            "Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (2.0.3)\n",
            "Requirement already satisfied: pillow>=9.0.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (9.4.0)\n",
            "Requirement already satisfied: tenacity!=8.4.0,<9.0.0,>=8.2.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (8.5.0)\n",
            "Requirement already satisfied: tiktoken>=0.3.3 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (0.7.0)\n",
            "Requirement already satisfied: typing-inspect>=0.8.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (0.9.0)\n",
            "Requirement already satisfied: wrapt in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (1.14.1)\n",
            "Requirement already satisfied: pydantic<3,>2 in /usr/local/lib/python3.10/dist-packages (from text-generation<0.8.0,>=0.7.0->llama-index-llms-huggingface) (2.8.2)\n",
            "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (1.13.1)\n",
            "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (3.1.4)\n",
            "Requirement already satisfied: nvidia-cuda-nvrtc-cu12==12.1.105 in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (12.1.105)\n",
            "Requirement already satisfied: nvidia-cuda-runtime-cu12==12.1.105 in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (12.1.105)\n",
            "Requirement already satisfied: nvidia-cuda-cupti-cu12==12.1.105 in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (12.1.105)\n",
            "Requirement already satisfied: nvidia-cudnn-cu12==8.9.2.26 in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (8.9.2.26)\n",
            "Requirement already satisfied: nvidia-cublas-cu12==12.1.3.1 in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (12.1.3.1)\n",
            "Requirement already satisfied: nvidia-cufft-cu12==11.0.2.54 in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (11.0.2.54)\n",
            "Requirement already satisfied: nvidia-curand-cu12==10.3.2.106 in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (10.3.2.106)\n",
            "Requirement already satisfied: nvidia-cusolver-cu12==11.4.5.107 in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (11.4.5.107)\n",
            "Requirement already satisfied: nvidia-cusparse-cu12==12.1.0.106 in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (12.1.0.106)\n",
            "Requirement already satisfied: nvidia-nccl-cu12==2.20.5 in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (2.20.5)\n",
            "Requirement already satisfied: nvidia-nvtx-cu12==12.1.105 in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (12.1.105)\n",
            "Requirement already satisfied: triton==2.3.1 in /usr/local/lib/python3.10/dist-packages (from torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (2.3.1)\n",
            "Requirement already satisfied: nvidia-nvjitlink-cu12 in /usr/local/lib/python3.10/dist-packages (from nvidia-cusolver-cu12==11.4.5.107->torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (12.5.82)\n",
            "Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.10/dist-packages (from transformers<5.0.0,>=4.37.0->transformers[torch]<5.0.0,>=4.37.0->llama-index-llms-huggingface) (2024.5.15)\n",
            "Requirement already satisfied: safetensors>=0.4.1 in /usr/local/lib/python3.10/dist-packages (from transformers<5.0.0,>=4.37.0->transformers[torch]<5.0.0,>=4.37.0->llama-index-llms-huggingface) (0.4.3)\n",
            "Requirement already satisfied: tokenizers<0.20,>=0.19 in /usr/local/lib/python3.10/dist-packages (from transformers<5.0.0,>=4.37.0->transformers[torch]<5.0.0,>=4.37.0->llama-index-llms-huggingface) (0.19.1)\n",
            "Requirement already satisfied: accelerate>=0.21.0 in /usr/local/lib/python3.10/dist-packages (from transformers[torch]<5.0.0,>=4.37.0->llama-index-llms-huggingface) (0.32.1)\n",
            "Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from accelerate>=0.21.0->transformers[torch]<5.0.0,>=4.37.0->llama-index-llms-huggingface) (5.9.5)\n",
            "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (1.3.1)\n",
            "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (23.2.0)\n",
            "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (1.4.1)\n",
            "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (6.0.5)\n",
            "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (1.9.4)\n",
            "Requirement already satisfied: async-timeout<5.0,>=4.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (4.0.3)\n",
            "Requirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (8.1.7)\n",
            "Requirement already satisfied: joblib in /usr/local/lib/python3.10/dist-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (1.4.2)\n",
            "Requirement already satisfied: anyio<5,>=3.5.0 in /usr/local/lib/python3.10/dist-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (3.7.1)\n",
            "Requirement already satisfied: distro<2,>=1.7.0 in /usr/lib/python3/dist-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (1.7.0)\n",
            "Requirement already satisfied: sniffio in /usr/local/lib/python3.10/dist-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (1.3.1)\n",
            "Requirement already satisfied: certifi in /usr/local/lib/python3.10/dist-packages (from httpx->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (2024.7.4)\n",
            "Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.10/dist-packages (from httpx->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (1.0.5)\n",
            "Requirement already satisfied: idna in /usr/local/lib/python3.10/dist-packages (from httpx->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (3.7)\n",
            "Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.10/dist-packages (from httpcore==1.*->httpx->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (0.14.0)\n",
            "Requirement already satisfied: annotated-types>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from pydantic<3,>2->text-generation<0.8.0,>=0.7.0->llama-index-llms-huggingface) (0.7.0)\n",
            "Requirement already satisfied: pydantic-core==2.20.1 in /usr/local/lib/python3.10/dist-packages (from pydantic<3,>2->text-generation<0.8.0,>=0.7.0->llama-index-llms-huggingface) (2.20.1)\n",
            "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface-hub<0.24.0,>=0.23.0->llama-index-llms-huggingface) (3.3.2)\n",
            "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface-hub<0.24.0,>=0.23.0->llama-index-llms-huggingface) (2.0.7)\n",
            "Requirement already satisfied: greenlet!=0.4.17 in /usr/local/lib/python3.10/dist-packages (from SQLAlchemy>=1.4.49->SQLAlchemy[asyncio]>=1.4.49->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (3.0.3)\n",
            "Requirement already satisfied: mypy-extensions>=0.3.0 in /usr/local/lib/python3.10/dist-packages (from typing-inspect>=0.8.0->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (1.0.0)\n",
            "Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in /usr/local/lib/python3.10/dist-packages (from dataclasses-json->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (3.21.3)\n",
            "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (2.1.5)\n",
            "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from pandas->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (2.8.2)\n",
            "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (2023.4)\n",
            "Requirement already satisfied: tzdata>=2022.1 in /usr/local/lib/python3.10/dist-packages (from pandas->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (2024.1)\n",
            "Requirement already satisfied: mpmath<1.4,>=1.1.0 in /usr/local/lib/python3.10/dist-packages (from sympy->torch<3.0.0,>=2.1.2->llama-index-llms-huggingface) (1.3.0)\n",
            "Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from anyio<5,>=3.5.0->openai>=1.1.0->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (1.2.2)\n",
            "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.2->pandas->llama-index-core<0.11.0,>=0.10.57->llama-index-llms-huggingface) (1.16.0)\n",
            "Requirement already satisfied: llama-index-readers-web in /usr/local/lib/python3.10/dist-packages (0.1.23)\n",
            "Requirement already satisfied: aiohttp<4.0.0,>=3.9.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-readers-web) (3.9.5)\n",
            "Requirement already satisfied: beautifulsoup4<5.0.0,>=4.12.3 in /usr/local/lib/python3.10/dist-packages (from llama-index-readers-web) (4.12.3)\n",
            "Requirement already satisfied: chromedriver-autoinstaller<0.7.0,>=0.6.3 in /usr/local/lib/python3.10/dist-packages (from llama-index-readers-web) (0.6.4)\n",
            "Requirement already satisfied: html2text<2025.0.0,>=2024.2.26 in /usr/local/lib/python3.10/dist-packages (from llama-index-readers-web) (2024.2.26)\n",
            "Requirement already satisfied: llama-index-core<0.11.0,>=0.10.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-readers-web) (0.10.58)\n",
            "Requirement already satisfied: newspaper3k<0.3.0,>=0.2.8 in /usr/local/lib/python3.10/dist-packages (from llama-index-readers-web) (0.2.8)\n",
            "Requirement already satisfied: playwright<2.0,>=1.30 in /usr/local/lib/python3.10/dist-packages (from llama-index-readers-web) (1.45.1)\n",
            "Requirement already satisfied: requests<3.0.0,>=2.31.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-readers-web) (2.31.0)\n",
            "Requirement already satisfied: selenium<5.0.0,>=4.17.2 in /usr/local/lib/python3.10/dist-packages (from llama-index-readers-web) (4.23.1)\n",
            "Requirement already satisfied: spider-client<0.0.28,>=0.0.27 in /usr/local/lib/python3.10/dist-packages (from llama-index-readers-web) (0.0.27)\n",
            "Requirement already satisfied: urllib3>=1.1.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-readers-web) (2.0.7)\n",
            "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.9.1->llama-index-readers-web) (1.3.1)\n",
            "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.9.1->llama-index-readers-web) (23.2.0)\n",
            "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.9.1->llama-index-readers-web) (1.4.1)\n",
            "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.9.1->llama-index-readers-web) (6.0.5)\n",
            "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.9.1->llama-index-readers-web) (1.9.4)\n",
            "Requirement already satisfied: async-timeout<5.0,>=4.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.9.1->llama-index-readers-web) (4.0.3)\n",
            "Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.10/dist-packages (from beautifulsoup4<5.0.0,>=4.12.3->llama-index-readers-web) (2.5)\n",
            "Requirement already satisfied: packaging>=23.1 in /usr/local/lib/python3.10/dist-packages (from chromedriver-autoinstaller<0.7.0,>=0.6.3->llama-index-readers-web) (24.1)\n",
            "Requirement already satisfied: PyYAML>=6.0.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (6.0.1)\n",
            "Requirement already satisfied: SQLAlchemy>=1.4.49 in /usr/local/lib/python3.10/dist-packages (from SQLAlchemy[asyncio]>=1.4.49->llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (2.0.31)\n",
            "Requirement already satisfied: dataclasses-json in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (0.6.7)\n",
            "Requirement already satisfied: deprecated>=1.2.9.3 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (1.2.14)\n",
            "Requirement already satisfied: dirtyjson<2.0.0,>=1.0.8 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (1.0.8)\n",
            "Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (2023.6.0)\n",
            "Requirement already satisfied: httpx in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (0.27.0)\n",
            "Requirement already satisfied: nest-asyncio<2.0.0,>=1.5.8 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (1.6.0)\n",
            "Requirement already satisfied: networkx>=3.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (3.3)\n",
            "Requirement already satisfied: nltk<4.0.0,>=3.8.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (3.8.1)\n",
            "Requirement already satisfied: numpy<2.0.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (1.25.2)\n",
            "Requirement already satisfied: openai>=1.1.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (1.37.1)\n",
            "Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (2.0.3)\n",
            "Requirement already satisfied: pillow>=9.0.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (9.4.0)\n",
            "Requirement already satisfied: tenacity!=8.4.0,<9.0.0,>=8.2.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (8.5.0)\n",
            "Requirement already satisfied: tiktoken>=0.3.3 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (0.7.0)\n",
            "Requirement already satisfied: tqdm<5.0.0,>=4.66.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (4.66.4)\n",
            "Requirement already satisfied: typing-extensions>=4.5.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (4.12.2)\n",
            "Requirement already satisfied: typing-inspect>=0.8.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (0.9.0)\n",
            "Requirement already satisfied: wrapt in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (1.14.1)\n",
            "Requirement already satisfied: cssselect>=0.9.2 in /usr/local/lib/python3.10/dist-packages (from newspaper3k<0.3.0,>=0.2.8->llama-index-readers-web) (1.2.0)\n",
            "Requirement already satisfied: lxml>=3.6.0 in /usr/local/lib/python3.10/dist-packages (from newspaper3k<0.3.0,>=0.2.8->llama-index-readers-web) (4.9.4)\n",
            "Requirement already satisfied: feedparser>=5.2.1 in /usr/local/lib/python3.10/dist-packages (from newspaper3k<0.3.0,>=0.2.8->llama-index-readers-web) (6.0.11)\n",
            "Requirement already satisfied: tldextract>=2.0.1 in /usr/local/lib/python3.10/dist-packages (from newspaper3k<0.3.0,>=0.2.8->llama-index-readers-web) (5.1.2)\n",
            "Requirement already satisfied: feedfinder2>=0.0.4 in /usr/local/lib/python3.10/dist-packages (from newspaper3k<0.3.0,>=0.2.8->llama-index-readers-web) (0.0.4)\n",
            "Requirement already satisfied: jieba3k>=0.35.1 in /usr/local/lib/python3.10/dist-packages (from newspaper3k<0.3.0,>=0.2.8->llama-index-readers-web) (0.35.1)\n",
            "Requirement already satisfied: python-dateutil>=2.5.3 in /usr/local/lib/python3.10/dist-packages (from newspaper3k<0.3.0,>=0.2.8->llama-index-readers-web) (2.8.2)\n",
            "Requirement already satisfied: tinysegmenter==0.3 in /usr/local/lib/python3.10/dist-packages (from newspaper3k<0.3.0,>=0.2.8->llama-index-readers-web) (0.3)\n",
            "Requirement already satisfied: greenlet==3.0.3 in /usr/local/lib/python3.10/dist-packages (from playwright<2.0,>=1.30->llama-index-readers-web) (3.0.3)\n",
            "Requirement already satisfied: pyee==11.1.0 in /usr/local/lib/python3.10/dist-packages (from playwright<2.0,>=1.30->llama-index-readers-web) (11.1.0)\n",
            "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.31.0->llama-index-readers-web) (3.3.2)\n",
            "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.31.0->llama-index-readers-web) (3.7)\n",
            "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.31.0->llama-index-readers-web) (2024.7.4)\n",
            "Requirement already satisfied: trio~=0.17 in /usr/local/lib/python3.10/dist-packages (from selenium<5.0.0,>=4.17.2->llama-index-readers-web) (0.26.0)\n",
            "Requirement already satisfied: trio-websocket~=0.9 in /usr/local/lib/python3.10/dist-packages (from selenium<5.0.0,>=4.17.2->llama-index-readers-web) (0.11.1)\n",
            "Requirement already satisfied: websocket-client~=1.8 in /usr/local/lib/python3.10/dist-packages (from selenium<5.0.0,>=4.17.2->llama-index-readers-web) (1.8.0)\n",
            "Requirement already satisfied: six in /usr/local/lib/python3.10/dist-packages (from feedfinder2>=0.0.4->newspaper3k<0.3.0,>=0.2.8->llama-index-readers-web) (1.16.0)\n",
            "Requirement already satisfied: sgmllib3k in /usr/local/lib/python3.10/dist-packages (from feedparser>=5.2.1->newspaper3k<0.3.0,>=0.2.8->llama-index-readers-web) (1.0.0)\n",
            "Requirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (8.1.7)\n",
            "Requirement already satisfied: joblib in /usr/local/lib/python3.10/dist-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (1.4.2)\n",
            "Requirement already satisfied: regex>=2021.8.3 in /usr/local/lib/python3.10/dist-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (2024.5.15)\n",
            "Requirement already satisfied: anyio<5,>=3.5.0 in /usr/local/lib/python3.10/dist-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (3.7.1)\n",
            "Requirement already satisfied: distro<2,>=1.7.0 in /usr/lib/python3/dist-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (1.7.0)\n",
            "Requirement already satisfied: pydantic<3,>=1.9.0 in /usr/local/lib/python3.10/dist-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (2.8.2)\n",
            "Requirement already satisfied: sniffio in /usr/local/lib/python3.10/dist-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (1.3.1)\n",
            "Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.10/dist-packages (from httpx->llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (1.0.5)\n",
            "Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.10/dist-packages (from httpcore==1.*->httpx->llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (0.14.0)\n",
            "Requirement already satisfied: requests-file>=1.4 in /usr/local/lib/python3.10/dist-packages (from tldextract>=2.0.1->newspaper3k<0.3.0,>=0.2.8->llama-index-readers-web) (2.1.0)\n",
            "Requirement already satisfied: filelock>=3.0.8 in /usr/local/lib/python3.10/dist-packages (from tldextract>=2.0.1->newspaper3k<0.3.0,>=0.2.8->llama-index-readers-web) (3.15.4)\n",
            "Requirement already satisfied: sortedcontainers in /usr/local/lib/python3.10/dist-packages (from trio~=0.17->selenium<5.0.0,>=4.17.2->llama-index-readers-web) (2.4.0)\n",
            "Requirement already satisfied: outcome in /usr/local/lib/python3.10/dist-packages (from trio~=0.17->selenium<5.0.0,>=4.17.2->llama-index-readers-web) (1.3.0.post0)\n",
            "Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from trio~=0.17->selenium<5.0.0,>=4.17.2->llama-index-readers-web) (1.2.2)\n",
            "Requirement already satisfied: wsproto>=0.14 in /usr/local/lib/python3.10/dist-packages (from trio-websocket~=0.9->selenium<5.0.0,>=4.17.2->llama-index-readers-web) (1.2.0)\n",
            "Requirement already satisfied: mypy-extensions>=0.3.0 in /usr/local/lib/python3.10/dist-packages (from typing-inspect>=0.8.0->llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (1.0.0)\n",
            "Requirement already satisfied: pysocks!=1.5.7,<2.0,>=1.5.6 in /usr/local/lib/python3.10/dist-packages (from urllib3[socks]<3,>=1.26->selenium<5.0.0,>=4.17.2->llama-index-readers-web) (1.7.1)\n",
            "Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in /usr/local/lib/python3.10/dist-packages (from dataclasses-json->llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (3.21.3)\n",
            "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (2023.4)\n",
            "Requirement already satisfied: tzdata>=2022.1 in /usr/local/lib/python3.10/dist-packages (from pandas->llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (2024.1)\n",
            "Requirement already satisfied: annotated-types>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from pydantic<3,>=1.9.0->openai>=1.1.0->llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (0.7.0)\n",
            "Requirement already satisfied: pydantic-core==2.20.1 in /usr/local/lib/python3.10/dist-packages (from pydantic<3,>=1.9.0->openai>=1.1.0->llama-index-core<0.11.0,>=0.10.1->llama-index-readers-web) (2.20.1)\n",
            "Requirement already satisfied: llama-index-llms-yi in /usr/local/lib/python3.10/dist-packages (0.1.1)\n",
            "Requirement already satisfied: llama-index-core<0.11.0,>=0.10.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-llms-yi) (0.10.58)\n",
            "Requirement already satisfied: llama-index-llms-openai<0.2.0,>=0.1.23 in /usr/local/lib/python3.10/dist-packages (from llama-index-llms-yi) (0.1.27)\n",
            "Requirement already satisfied: transformers<5.0.0,>=4.41.2 in /usr/local/lib/python3.10/dist-packages (from llama-index-llms-yi) (4.42.4)\n",
            "Requirement already satisfied: PyYAML>=6.0.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (6.0.1)\n",
            "Requirement already satisfied: SQLAlchemy>=1.4.49 in /usr/local/lib/python3.10/dist-packages (from SQLAlchemy[asyncio]>=1.4.49->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (2.0.31)\n",
            "Requirement already satisfied: aiohttp<4.0.0,>=3.8.6 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (3.9.5)\n",
            "Requirement already satisfied: dataclasses-json in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (0.6.7)\n",
            "Requirement already satisfied: deprecated>=1.2.9.3 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (1.2.14)\n",
            "Requirement already satisfied: dirtyjson<2.0.0,>=1.0.8 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (1.0.8)\n",
            "Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (2023.6.0)\n",
            "Requirement already satisfied: httpx in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (0.27.0)\n",
            "Requirement already satisfied: nest-asyncio<2.0.0,>=1.5.8 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (1.6.0)\n",
            "Requirement already satisfied: networkx>=3.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (3.3)\n",
            "Requirement already satisfied: nltk<4.0.0,>=3.8.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (3.8.1)\n",
            "Requirement already satisfied: numpy<2.0.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (1.25.2)\n",
            "Requirement already satisfied: openai>=1.1.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (1.37.1)\n",
            "Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (2.0.3)\n",
            "Requirement already satisfied: pillow>=9.0.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (9.4.0)\n",
            "Requirement already satisfied: requests>=2.31.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (2.31.0)\n",
            "Requirement already satisfied: tenacity!=8.4.0,<9.0.0,>=8.2.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (8.5.0)\n",
            "Requirement already satisfied: tiktoken>=0.3.3 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (0.7.0)\n",
            "Requirement already satisfied: tqdm<5.0.0,>=4.66.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (4.66.4)\n",
            "Requirement already satisfied: typing-extensions>=4.5.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (4.12.2)\n",
            "Requirement already satisfied: typing-inspect>=0.8.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (0.9.0)\n",
            "Requirement already satisfied: wrapt in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (1.14.1)\n",
            "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from transformers<5.0.0,>=4.41.2->llama-index-llms-yi) (3.15.4)\n",
            "Requirement already satisfied: huggingface-hub<1.0,>=0.23.2 in /usr/local/lib/python3.10/dist-packages (from transformers<5.0.0,>=4.41.2->llama-index-llms-yi) (0.23.5)\n",
            "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from transformers<5.0.0,>=4.41.2->llama-index-llms-yi) (24.1)\n",
            "Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.10/dist-packages (from transformers<5.0.0,>=4.41.2->llama-index-llms-yi) (2024.5.15)\n",
            "Requirement already satisfied: safetensors>=0.4.1 in /usr/local/lib/python3.10/dist-packages (from transformers<5.0.0,>=4.41.2->llama-index-llms-yi) (0.4.3)\n",
            "Requirement already satisfied: tokenizers<0.20,>=0.19 in /usr/local/lib/python3.10/dist-packages (from transformers<5.0.0,>=4.41.2->llama-index-llms-yi) (0.19.1)\n",
            "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (1.3.1)\n",
            "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (23.2.0)\n",
            "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (1.4.1)\n",
            "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (6.0.5)\n",
            "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (1.9.4)\n",
            "Requirement already satisfied: async-timeout<5.0,>=4.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.6->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (4.0.3)\n",
            "Requirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (8.1.7)\n",
            "Requirement already satisfied: joblib in /usr/local/lib/python3.10/dist-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (1.4.2)\n",
            "Requirement already satisfied: anyio<5,>=3.5.0 in /usr/local/lib/python3.10/dist-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (3.7.1)\n",
            "Requirement already satisfied: distro<2,>=1.7.0 in /usr/lib/python3/dist-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (1.7.0)\n",
            "Requirement already satisfied: pydantic<3,>=1.9.0 in /usr/local/lib/python3.10/dist-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (2.8.2)\n",
            "Requirement already satisfied: sniffio in /usr/local/lib/python3.10/dist-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (1.3.1)\n",
            "Requirement already satisfied: certifi in /usr/local/lib/python3.10/dist-packages (from httpx->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (2024.7.4)\n",
            "Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.10/dist-packages (from httpx->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (1.0.5)\n",
            "Requirement already satisfied: idna in /usr/local/lib/python3.10/dist-packages (from httpx->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (3.7)\n",
            "Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.10/dist-packages (from httpcore==1.*->httpx->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (0.14.0)\n",
            "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.31.0->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (3.3.2)\n",
            "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.31.0->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (2.0.7)\n",
            "Requirement already satisfied: greenlet!=0.4.17 in /usr/local/lib/python3.10/dist-packages (from SQLAlchemy>=1.4.49->SQLAlchemy[asyncio]>=1.4.49->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (3.0.3)\n",
            "Requirement already satisfied: mypy-extensions>=0.3.0 in /usr/local/lib/python3.10/dist-packages (from typing-inspect>=0.8.0->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (1.0.0)\n",
            "Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in /usr/local/lib/python3.10/dist-packages (from dataclasses-json->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (3.21.3)\n",
            "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from pandas->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (2.8.2)\n",
            "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (2023.4)\n",
            "Requirement already satisfied: tzdata>=2022.1 in /usr/local/lib/python3.10/dist-packages (from pandas->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (2024.1)\n",
            "Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from anyio<5,>=3.5.0->openai>=1.1.0->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (1.2.2)\n",
            "Requirement already satisfied: annotated-types>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from pydantic<3,>=1.9.0->openai>=1.1.0->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (0.7.0)\n",
            "Requirement already satisfied: pydantic-core==2.20.1 in /usr/local/lib/python3.10/dist-packages (from pydantic<3,>=1.9.0->openai>=1.1.0->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (2.20.1)\n",
            "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.2->pandas->llama-index-core<0.11.0,>=0.10.0->llama-index-llms-yi) (1.16.0)\n",
            "Collecting llama-index-embeddings-huggingface\n",
            "  Downloading llama_index_embeddings_huggingface-0.2.2-py3-none-any.whl.metadata (769 bytes)\n",
            "Requirement already satisfied: huggingface-hub>=0.19.0 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (0.23.5)\n",
            "Requirement already satisfied: llama-index-core<0.11.0,>=0.10.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-embeddings-huggingface) (0.10.58)\n",
            "Collecting sentence-transformers>=2.6.1 (from llama-index-embeddings-huggingface)\n",
            "  Downloading sentence_transformers-3.0.1-py3-none-any.whl.metadata (10 kB)\n",
            "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.19.0->huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (3.15.4)\n",
            "Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.19.0->huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (2023.6.0)\n",
            "Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.19.0->huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (24.1)\n",
            "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.19.0->huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (6.0.1)\n",
            "Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.19.0->huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (2.31.0)\n",
            "Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.19.0->huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (4.66.4)\n",
            "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.19.0->huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (4.12.2)\n",
            "Requirement already satisfied: aiohttp in /usr/local/lib/python3.10/dist-packages (from huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (3.9.5)\n",
            "Collecting minijinja>=1.0 (from huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface)\n",
            "  Downloading minijinja-2.0.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (8.8 kB)\n",
            "Requirement already satisfied: SQLAlchemy>=1.4.49 in /usr/local/lib/python3.10/dist-packages (from SQLAlchemy[asyncio]>=1.4.49->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (2.0.31)\n",
            "Requirement already satisfied: dataclasses-json in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (0.6.7)\n",
            "Requirement already satisfied: deprecated>=1.2.9.3 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (1.2.14)\n",
            "Requirement already satisfied: dirtyjson<2.0.0,>=1.0.8 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (1.0.8)\n",
            "Requirement already satisfied: httpx in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (0.27.0)\n",
            "Requirement already satisfied: nest-asyncio<2.0.0,>=1.5.8 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (1.6.0)\n",
            "Requirement already satisfied: networkx>=3.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (3.3)\n",
            "Requirement already satisfied: nltk<4.0.0,>=3.8.1 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (3.8.1)\n",
            "Requirement already satisfied: numpy<2.0.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (1.25.2)\n",
            "Requirement already satisfied: openai>=1.1.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (1.37.1)\n",
            "Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (2.0.3)\n",
            "Requirement already satisfied: pillow>=9.0.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (9.4.0)\n",
            "Requirement already satisfied: tenacity!=8.4.0,<9.0.0,>=8.2.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (8.5.0)\n",
            "Requirement already satisfied: tiktoken>=0.3.3 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (0.7.0)\n",
            "Requirement already satisfied: typing-inspect>=0.8.0 in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (0.9.0)\n",
            "Requirement already satisfied: wrapt in /usr/local/lib/python3.10/dist-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (1.14.1)\n",
            "Requirement already satisfied: transformers<5.0.0,>=4.34.0 in /usr/local/lib/python3.10/dist-packages (from sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (4.42.4)\n",
            "Requirement already satisfied: torch>=1.11.0 in /usr/local/lib/python3.10/dist-packages (from sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (2.3.1+cu121)\n",
            "Requirement already satisfied: scikit-learn in /usr/local/lib/python3.10/dist-packages (from sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (1.2.2)\n",
            "Requirement already satisfied: scipy in /usr/local/lib/python3.10/dist-packages (from sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (1.11.4)\n",
            "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp->huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (1.3.1)\n",
            "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (23.2.0)\n",
            "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp->huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (1.4.1)\n",
            "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp->huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (6.0.5)\n",
            "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (1.9.4)\n",
            "Requirement already satisfied: async-timeout<5.0,>=4.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (4.0.3)\n",
            "Requirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (8.1.7)\n",
            "Requirement already satisfied: joblib in /usr/local/lib/python3.10/dist-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (1.4.2)\n",
            "Requirement already satisfied: regex>=2021.8.3 in /usr/local/lib/python3.10/dist-packages (from nltk<4.0.0,>=3.8.1->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (2024.5.15)\n",
            "Requirement already satisfied: anyio<5,>=3.5.0 in /usr/local/lib/python3.10/dist-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (3.7.1)\n",
            "Requirement already satisfied: distro<2,>=1.7.0 in /usr/lib/python3/dist-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (1.7.0)\n",
            "Requirement already satisfied: pydantic<3,>=1.9.0 in /usr/local/lib/python3.10/dist-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (2.8.2)\n",
            "Requirement already satisfied: sniffio in /usr/local/lib/python3.10/dist-packages (from openai>=1.1.0->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (1.3.1)\n",
            "Requirement already satisfied: certifi in /usr/local/lib/python3.10/dist-packages (from httpx->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (2024.7.4)\n",
            "Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.10/dist-packages (from httpx->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (1.0.5)\n",
            "Requirement already satisfied: idna in /usr/local/lib/python3.10/dist-packages (from httpx->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (3.7)\n",
            "Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.10/dist-packages (from httpcore==1.*->httpx->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (0.14.0)\n",
            "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface-hub>=0.19.0->huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (3.3.2)\n",
            "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface-hub>=0.19.0->huggingface-hub[inference]>=0.19.0->llama-index-embeddings-huggingface) (2.0.7)\n",
            "Requirement already satisfied: greenlet!=0.4.17 in /usr/local/lib/python3.10/dist-packages (from SQLAlchemy>=1.4.49->SQLAlchemy[asyncio]>=1.4.49->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (3.0.3)\n",
            "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (1.13.1)\n",
            "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (3.1.4)\n",
            "Requirement already satisfied: nvidia-cuda-nvrtc-cu12==12.1.105 in /usr/local/lib/python3.10/dist-packages (from torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (12.1.105)\n",
            "Requirement already satisfied: nvidia-cuda-runtime-cu12==12.1.105 in /usr/local/lib/python3.10/dist-packages (from torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (12.1.105)\n",
            "Requirement already satisfied: nvidia-cuda-cupti-cu12==12.1.105 in /usr/local/lib/python3.10/dist-packages (from torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (12.1.105)\n",
            "Requirement already satisfied: nvidia-cudnn-cu12==8.9.2.26 in /usr/local/lib/python3.10/dist-packages (from torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (8.9.2.26)\n",
            "Requirement already satisfied: nvidia-cublas-cu12==12.1.3.1 in /usr/local/lib/python3.10/dist-packages (from torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (12.1.3.1)\n",
            "Requirement already satisfied: nvidia-cufft-cu12==11.0.2.54 in /usr/local/lib/python3.10/dist-packages (from torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (11.0.2.54)\n",
            "Requirement already satisfied: nvidia-curand-cu12==10.3.2.106 in /usr/local/lib/python3.10/dist-packages (from torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (10.3.2.106)\n",
            "Requirement already satisfied: nvidia-cusolver-cu12==11.4.5.107 in /usr/local/lib/python3.10/dist-packages (from torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (11.4.5.107)\n",
            "Requirement already satisfied: nvidia-cusparse-cu12==12.1.0.106 in /usr/local/lib/python3.10/dist-packages (from torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (12.1.0.106)\n",
            "Requirement already satisfied: nvidia-nccl-cu12==2.20.5 in /usr/local/lib/python3.10/dist-packages (from torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (2.20.5)\n",
            "Requirement already satisfied: nvidia-nvtx-cu12==12.1.105 in /usr/local/lib/python3.10/dist-packages (from torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (12.1.105)\n",
            "Requirement already satisfied: triton==2.3.1 in /usr/local/lib/python3.10/dist-packages (from torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (2.3.1)\n",
            "Requirement already satisfied: nvidia-nvjitlink-cu12 in /usr/local/lib/python3.10/dist-packages (from nvidia-cusolver-cu12==11.4.5.107->torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (12.5.82)\n",
            "Requirement already satisfied: safetensors>=0.4.1 in /usr/local/lib/python3.10/dist-packages (from transformers<5.0.0,>=4.34.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (0.4.3)\n",
            "Requirement already satisfied: tokenizers<0.20,>=0.19 in /usr/local/lib/python3.10/dist-packages (from transformers<5.0.0,>=4.34.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (0.19.1)\n",
            "Requirement already satisfied: mypy-extensions>=0.3.0 in /usr/local/lib/python3.10/dist-packages (from typing-inspect>=0.8.0->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (1.0.0)\n",
            "Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in /usr/local/lib/python3.10/dist-packages (from dataclasses-json->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (3.21.3)\n",
            "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from pandas->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (2.8.2)\n",
            "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (2023.4)\n",
            "Requirement already satisfied: tzdata>=2022.1 in /usr/local/lib/python3.10/dist-packages (from pandas->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (2024.1)\n",
            "Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from scikit-learn->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (3.5.0)\n",
            "Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from anyio<5,>=3.5.0->openai>=1.1.0->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (1.2.2)\n",
            "Requirement already satisfied: annotated-types>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from pydantic<3,>=1.9.0->openai>=1.1.0->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (0.7.0)\n",
            "Requirement already satisfied: pydantic-core==2.20.1 in /usr/local/lib/python3.10/dist-packages (from pydantic<3,>=1.9.0->openai>=1.1.0->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (2.20.1)\n",
            "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.2->pandas->llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-huggingface) (1.16.0)\n",
            "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (2.1.5)\n",
            "Requirement already satisfied: mpmath<1.4,>=1.1.0 in /usr/local/lib/python3.10/dist-packages (from sympy->torch>=1.11.0->sentence-transformers>=2.6.1->llama-index-embeddings-huggingface) (1.3.0)\n",
            "Downloading llama_index_embeddings_huggingface-0.2.2-py3-none-any.whl (7.2 kB)\n",
            "Downloading sentence_transformers-3.0.1-py3-none-any.whl (227 kB)\n",
            "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m227.1/227.1 kB\u001b[0m \u001b[31m4.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hDownloading minijinja-2.0.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (853 kB)\n",
            "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m853.2/853.2 kB\u001b[0m \u001b[31m22.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hInstalling collected packages: minijinja, sentence-transformers, llama-index-embeddings-huggingface\n",
            "Successfully installed llama-index-embeddings-huggingface-0.2.2 minijinja-2.0.1 sentence-transformers-3.0.1\n"
          ]
        }
      ],
      "source": [
        "# 安装所需的Python包\n",
        "!pip install llama-index\n",
        "!pip install llama-index-llms-huggingface\n",
        "!pip install llama-index-readers-web\n",
        "!pip install llama-index-llms-yi\n",
        "!pip install llama-index-embeddings-huggingface\n"
      ],
      "id": "6989tVXX8dLh"
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "XlxCBbmI8dLi"
      },
      "source": [
        "### 初始化Yi的API\n",
        "\n",
        "前往[零一万物开放平台](https://platform.lingyiwanwu.com/),注册并获取免费的API额度来体验yi-large API。\n",
        "然后点击[这里](https://platform.lingyiwanwu.com/apikeys),申请你的API密钥(api_key)。\n",
        "\n",
        "导入依赖包,并初始化api平台,你只需要在`your_api_key`处替换成你申请的api_key即可。\n"
      ],
      "id": "XlxCBbmI8dLi"
    },
    {
      "cell_type": "code",
      "execution_count": 4,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 496,
          "referenced_widgets": [
            "e2b2f20ae7184ffba003dfeea232dff4",
            "9bf4ca7e24384defbbe134ede45a5f55",
            "813a8fb61a38405e81f6ef382800a27d",
            "409d459c799e44c48148316ba3c2105b",
            "bacd0a07840d49208d3faf6849d4a695",
            "cd496a6f1f864d3fbf870048b745ffac",
            "d1383ea0e9e84067927a86766822919a",
            "041dc93008174483aa6f72d683172d48",
            "c5a37cd000d240a284c039be3a8d57d5",
            "070ec3aedee04bcaba65cfd2e5dcfa96",
            "b9b3158be10b45ae8f9a5e972013604d",
            "199361f243d147b6bbe2f55ce9b72c80",
            "2fb404eee06e44dcbd8105f36a7e2f72",
            "d61aabe910b94a0db6872be80cc3146f",
            "da7f9de9138e4731ac3b090553b696b9",
            "ec942d92380841889579f58edeb97362",
            "2fc87cd6af7f4c5faea8be4e50a09ee3",
            "9f99e802f06d4911870327aba576bd33",
            "2adb5fb653d9410cb6c650e8efc45a56",
            "aaeeac247424438084770ec4d018cc7e",
            "5189a3eac7ee4a15b11f5fd61851ccfa",
            "28938d0431ff4ccca0f2a79a749f2758",
            "0e07131aa035467586cffb608fe25e97",
            "c99ac8b4df9b4e15917d7fa9809b4155",
            "1ce285c4388f41e38bae25633968d005",
            "7c63fce93bc541f5b04d6a42f504fb8c",
            "5b8303b9a34544e7ba586540d175f780",
            "3dd19b771d9d41eca3860c717682b4d1",
            "f58a6d136b1549eeb4f9995cdd9e1acc",
            "2dfa7b67d97a4cc68634ffc439bc8fe5",
            "d4cade8f2655472eb321cd20ff761d92",
            "7e4d37d70f7845aa9da6768d5caba78f",
            "abadfe692f8943d388fc8a7be52a1aa4",
            "b2d6330b1da14e489f2d2b17da11ee64",
            "3ee5e7d6905e46a6894d460a8082aea8",
            "0e797ac66ee44d22a26e2b0d8c633410",
            "e7f4f3e8be3d449581aabc13aeb3c21d",
            "67828cfaca584088ba64c689d832c868",
            "bde4143bf0a344db861c061730c60c82",
            "0aa5cacdf0174a8bbb19e45916d56c7f",
            "d7a4ae0c5975478ab76ac3ba5762e328",
            "48154f023f0f49df8d5e7cd2423d2f42",
            "ea1dc43ac9d4431aaed4b52ca646d5c2",
            "efce65018165401f8ba90cbbfab81b7f",
            "57839b3f74724901ad612b120d34ad0b",
            "bddb067262c2492a8c78d933fa424495",
            "04673bad339843a58afe7f64388d139a",
            "17817ca265864db6aac8af3213dadc5a",
            "e176b1c2564f47f99b256fd1ef0ab97d",
            "d27c99deae644992b43d30602dea8dc1",
            "08c1378302de4777ae519153513c1525",
            "517a18d2b0c44405a4c873068eea0dcf",
            "689d5316c5c44e0dbe0b5a09914a46cf",
            "7f36764850e4446ab1fff6a3f7ceeca5",
            "0a6dfae2d40247de8e3150b2a1c533e3",
            "e22ec5f7451e4b4686671ffef79a87c1",
            "872b05d5c9d74d28a474452de7f3d226",
            "2abec01e88684f5da5bfda65e4a8578d",
            "cf1feaf2d70e4be09f699d68e3d82774",
            "7a9108ef7ab14041a9880380c9cbcebf",
            "e44ec3e6c2bc4c2ea928ffabd7ae8e2a",
            "87f6ded0498b4f17a2611275abac4d2c",
            "d6ff492bdc3a48a9ba0143616f1e6e12",
            "98eb3f43641a4279b5fa4e39820b91bb",
            "feadf72a9eea4497a7c8d0c2ea6d142b",
            "b2b7b167f5734d0fa1ea15c3718f6fe2",
            "aefdd835cffb4b38b15517dbbd73ae6b",
            "11dcc481051c44c9a0cb7bd1bd122e3a",
            "5b2ce1dd37ef419f95d6cd9b0a44db17",
            "76bea364d1404734badd91268d3a6a48",
            "1163d7edcbdd43cbbab7f78d662d29a0",
            "b014c6eb745d4a4aad323e820557b2a3",
            "3c894df8cbe84fb4b378fd75169a26ef",
            "11507fce31c04bde82fc83a8c96864f1",
            "f7ee20a759fa4e128bd0dfc48e6d96be",
            "0cb6e504998b48a79d4150fd822d7da3",
            "ab304a0183a74e0c8432375295304e9e",
            "e31705c798a345538a780e382a69edb6",
            "8d0dc1664b894e2d85ca805be7df74c8",
            "dffa0ae452c14d578249e161c74b68c7",
            "348684fd69764b3ca8c5e62e3162623e",
            "ea9f9028d6854d1d804cf99d30efae36",
            "f6dd9fd435d04669a0752bd06b268f37",
            "3d76de9ac3434923bfec0922fdd88d4a",
            "4e209d3ad87d42d79132e9018e49589c",
            "8d5c096f75b94d80b3ca4d1e2cc0b7ef",
            "921c8fee7007462f828fa335b8058ff3",
            "8657d0fb66e6416dbe63570a16817260",
            "70d058717dec4249a5e39fb34f665343",
            "9e28005318954bfaabdfa38a604cb437",
            "1511365783694baa9c5b3240a3ee5557",
            "d53cfe125e55453a8b4fdbfb8789053a",
            "8ce43cfb8fbb4bdab7f3e19628e4e664",
            "daa3dcfd8af84138b01d10e82436410a",
            "55b40ea2669f45098fbf8ba68150388e",
            "99ea1905fffa46af915d163ee3b3c2a6",
            "6ba0aec3fb234a20be5795b4d75bb694",
            "601dbce29e2b4084a8aab7ea12a2fa2f",
            "c5fa71afa0864de4b8e02618ca2fe135",
            "0253bf5b28ee4821a04bdbf12dfdfcd2",
            "977e1a408fbd406c80589ec42d7450e5",
            "c008d01e471a42dbbb378e092a0f8a40",
            "c26f533122e94d469e7f166c6fe2bf17",
            "745eef36df9244f98b14609c9c8fa4fc",
            "7d6d37666aea46ad95287864ba91827b",
            "44f25b6a9cce47e28a03253f2e14cb07",
            "26013520066840329ca5bb47f3968635",
            "e94256344794446e9e9c3192b627fcaa",
            "2f1f8120781240dd9ccb7321b2c67886",
            "92adcb872002404886488db745f5125d",
            "44c4fe12dc244c528450f39b4c4a2eb8",
            "594276b27e0f467291f467106731a76b",
            "0f6d5fe887914ba884663255bd26f1a3",
            "d7ec219f30c047b7988d8a1851e76d16",
            "912a239867f7440c8d1979621f5f29fd",
            "0649dd5fcb3c4969a50342359b21f32e",
            "92011c7dd33b4f17a8bd1d5a2effdfcd",
            "7f4b1d5859c54d069079c12a3d26a2f9",
            "a5f8fb452c6147208ad55bbb3f0e52ab",
            "b2152a2031b7429aba4874e838fa9070",
            "ac1f084b40f540df95e7e3332a7cca6b"
          ]
        },
        "id": "dY6eqq4u8dLi",
        "outputId": "5681aecb-b4b1-46c0-d12b-de41dc96741c"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_token.py:89: UserWarning: \n",
            "The secret `HF_TOKEN` does not exist in your Colab secrets.\n",
            "To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co/settings/tokens), set it as secret in your Google Colab and restart your session.\n",
            "You will be able to reuse this secret in all of your notebooks.\n",
            "Please note that authentication is recommended but still optional to access public models or datasets.\n",
            "  warnings.warn(\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "modules.json:   0%|          | 0.00/349 [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "e2b2f20ae7184ffba003dfeea232dff4"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "config_sentence_transformers.json:   0%|          | 0.00/124 [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "199361f243d147b6bbe2f55ce9b72c80"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "README.md:   0%|          | 0.00/27.8k [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "0e07131aa035467586cffb608fe25e97"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "sentence_bert_config.json:   0%|          | 0.00/52.0 [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "b2d6330b1da14e489f2d2b17da11ee64"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "config.json:   0%|          | 0.00/998 [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "57839b3f74724901ad612b120d34ad0b"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "pytorch_model.bin:   0%|          | 0.00/409M [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "e22ec5f7451e4b4686671ffef79a87c1"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "tokenizer_config.json:   0%|          | 0.00/366 [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "aefdd835cffb4b38b15517dbbd73ae6b"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "vocab.txt:   0%|          | 0.00/110k [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "e31705c798a345538a780e382a69edb6"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "tokenizer.json:   0%|          | 0.00/439k [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "70d058717dec4249a5e39fb34f665343"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "special_tokens_map.json:   0%|          | 0.00/125 [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "0253bf5b28ee4821a04bdbf12dfdfcd2"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "1_Pooling/config.json:   0%|          | 0.00/190 [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "44c4fe12dc244c528450f39b4c4a2eb8"
            }
          },
          "metadata": {}
        }
      ],
      "source": [
        "from llama_index.llms.yi import Yi\n",
        "from llama_index.readers.web import SimpleWebPageReader\n",
        "from llama_index.embeddings.huggingface import HuggingFaceEmbedding\n",
        "from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, Settings\n",
        "\n",
        "# 初始化API\n",
        "llm = Yi(model=\"yi-large\", api_key=\"your-api-key\")\n",
        "Settings.llm = llm\n",
        "Settings.embed_model = HuggingFaceEmbedding(model_name=\"BAAI/bge-base-zh-v1.5\")"
      ],
      "id": "dY6eqq4u8dLi"
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "AQWrtgZk8dLj"
      },
      "source": [
        "### 构建知识库\n",
        "\n",
        "在这里我们构建一个本地知识库。首先,加载需要索引的文档,然后使用`VectorStoreIndex`进行索引。\n"
      ],
      "id": "AQWrtgZk8dLj"
    },
    {
      "cell_type": "markdown",
      "source": [
        "这里请注意啦,data你可以在同级文件创建一个文件夹然后把数据放在里面就行啦!"
      ],
      "metadata": {
        "id": "RORbGmmc922u"
      },
      "id": "RORbGmmc922u"
    },
    {
      "cell_type": "code",
      "execution_count": 6,
      "metadata": {
        "id": "tLuQt9bf8dLj"
      },
      "outputs": [],
      "source": [
        "# 加载本地文档并构建索引\n",
        "documents = SimpleDirectoryReader(\"data\").load_data()\n",
        "index = VectorStoreIndex.from_documents(documents)\n",
        "query_engine = index.as_query_engine()"
      ],
      "id": "tLuQt9bf8dLj"
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "UwZK0WGY8dLj"
      },
      "source": [
        "### 进行对话交流\n",
        "\n",
        "现在,我们可以进行对话交流了。`yi-large`模型会基于检索到的文档生成答案。\n"
      ],
      "id": "UwZK0WGY8dLj"
    },
    {
      "cell_type": "code",
      "execution_count": 9,
      "metadata": {
        "id": "9hxFwnOJ8dLk"
      },
      "outputs": [],
      "source": [
        "# 开始对话\n",
        "while True:\n",
        "    user_input = input(\"user>> \")\n",
        "    response = query_engine.query(user_input)\n",
        "    print('Yi-large>>', response)"
      ],
      "id": "9hxFwnOJ8dLk"
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "SpqIG-_A8dLk"
      },
      "source": [
        "哈哈现在你已经完成了使用Yi的API构建RAG的基本步骤。你可以进一步探索和思考如何根据你自己的具体需求调整和优化你的RAG系统。"
      ],
      "id": "SpqIG-_A8dLk"
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.8.8"
    },
    "colab": {
      "provenance": [],
      "machine_shape": "hm"
    },
    "widgets": {
      "application/vnd.jupyter.widget-state+json": {
        "e2b2f20ae7184ffba003dfeea232dff4": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_9bf4ca7e24384defbbe134ede45a5f55",
              "IPY_MODEL_813a8fb61a38405e81f6ef382800a27d",
              "IPY_MODEL_409d459c799e44c48148316ba3c2105b"
            ],
            "layout": "IPY_MODEL_bacd0a07840d49208d3faf6849d4a695"
          }
        },
        "9bf4ca7e24384defbbe134ede45a5f55": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_cd496a6f1f864d3fbf870048b745ffac",
            "placeholder": "​",
            "style": "IPY_MODEL_d1383ea0e9e84067927a86766822919a",
            "value": "modules.json: 100%"
          }
        },
        "813a8fb61a38405e81f6ef382800a27d": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_041dc93008174483aa6f72d683172d48",
            "max": 349,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_c5a37cd000d240a284c039be3a8d57d5",
            "value": 349
          }
        },
        "409d459c799e44c48148316ba3c2105b": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_070ec3aedee04bcaba65cfd2e5dcfa96",
            "placeholder": "​",
            "style": "IPY_MODEL_b9b3158be10b45ae8f9a5e972013604d",
            "value": " 349/349 [00:00&lt;00:00, 22.9kB/s]"
          }
        },
        "bacd0a07840d49208d3faf6849d4a695": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "cd496a6f1f864d3fbf870048b745ffac": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "d1383ea0e9e84067927a86766822919a": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "041dc93008174483aa6f72d683172d48": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "c5a37cd000d240a284c039be3a8d57d5": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "070ec3aedee04bcaba65cfd2e5dcfa96": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "b9b3158be10b45ae8f9a5e972013604d": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "199361f243d147b6bbe2f55ce9b72c80": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_2fb404eee06e44dcbd8105f36a7e2f72",
              "IPY_MODEL_d61aabe910b94a0db6872be80cc3146f",
              "IPY_MODEL_da7f9de9138e4731ac3b090553b696b9"
            ],
            "layout": "IPY_MODEL_ec942d92380841889579f58edeb97362"
          }
        },
        "2fb404eee06e44dcbd8105f36a7e2f72": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_2fc87cd6af7f4c5faea8be4e50a09ee3",
            "placeholder": "​",
            "style": "IPY_MODEL_9f99e802f06d4911870327aba576bd33",
            "value": "config_sentence_transformers.json: 100%"
          }
        },
        "d61aabe910b94a0db6872be80cc3146f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_2adb5fb653d9410cb6c650e8efc45a56",
            "max": 124,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_aaeeac247424438084770ec4d018cc7e",
            "value": 124
          }
        },
        "da7f9de9138e4731ac3b090553b696b9": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_5189a3eac7ee4a15b11f5fd61851ccfa",
            "placeholder": "​",
            "style": "IPY_MODEL_28938d0431ff4ccca0f2a79a749f2758",
            "value": " 124/124 [00:00&lt;00:00, 7.88kB/s]"
          }
        },
        "ec942d92380841889579f58edeb97362": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "2fc87cd6af7f4c5faea8be4e50a09ee3": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "9f99e802f06d4911870327aba576bd33": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "2adb5fb653d9410cb6c650e8efc45a56": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "aaeeac247424438084770ec4d018cc7e": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "5189a3eac7ee4a15b11f5fd61851ccfa": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "28938d0431ff4ccca0f2a79a749f2758": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "0e07131aa035467586cffb608fe25e97": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_c99ac8b4df9b4e15917d7fa9809b4155",
              "IPY_MODEL_1ce285c4388f41e38bae25633968d005",
              "IPY_MODEL_7c63fce93bc541f5b04d6a42f504fb8c"
            ],
            "layout": "IPY_MODEL_5b8303b9a34544e7ba586540d175f780"
          }
        },
        "c99ac8b4df9b4e15917d7fa9809b4155": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_3dd19b771d9d41eca3860c717682b4d1",
            "placeholder": "​",
            "style": "IPY_MODEL_f58a6d136b1549eeb4f9995cdd9e1acc",
            "value": "README.md: 100%"
          }
        },
        "1ce285c4388f41e38bae25633968d005": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_2dfa7b67d97a4cc68634ffc439bc8fe5",
            "max": 27758,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_d4cade8f2655472eb321cd20ff761d92",
            "value": 27758
          }
        },
        "7c63fce93bc541f5b04d6a42f504fb8c": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_7e4d37d70f7845aa9da6768d5caba78f",
            "placeholder": "​",
            "style": "IPY_MODEL_abadfe692f8943d388fc8a7be52a1aa4",
            "value": " 27.8k/27.8k [00:00&lt;00:00, 1.70MB/s]"
          }
        },
        "5b8303b9a34544e7ba586540d175f780": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "3dd19b771d9d41eca3860c717682b4d1": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "f58a6d136b1549eeb4f9995cdd9e1acc": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "2dfa7b67d97a4cc68634ffc439bc8fe5": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "d4cade8f2655472eb321cd20ff761d92": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "7e4d37d70f7845aa9da6768d5caba78f": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "abadfe692f8943d388fc8a7be52a1aa4": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "b2d6330b1da14e489f2d2b17da11ee64": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_3ee5e7d6905e46a6894d460a8082aea8",
              "IPY_MODEL_0e797ac66ee44d22a26e2b0d8c633410",
              "IPY_MODEL_e7f4f3e8be3d449581aabc13aeb3c21d"
            ],
            "layout": "IPY_MODEL_67828cfaca584088ba64c689d832c868"
          }
        },
        "3ee5e7d6905e46a6894d460a8082aea8": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_bde4143bf0a344db861c061730c60c82",
            "placeholder": "​",
            "style": "IPY_MODEL_0aa5cacdf0174a8bbb19e45916d56c7f",
            "value": "sentence_bert_config.json: 100%"
          }
        },
        "0e797ac66ee44d22a26e2b0d8c633410": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_d7a4ae0c5975478ab76ac3ba5762e328",
            "max": 52,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_48154f023f0f49df8d5e7cd2423d2f42",
            "value": 52
          }
        },
        "e7f4f3e8be3d449581aabc13aeb3c21d": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_ea1dc43ac9d4431aaed4b52ca646d5c2",
            "placeholder": "​",
            "style": "IPY_MODEL_efce65018165401f8ba90cbbfab81b7f",
            "value": " 52.0/52.0 [00:00&lt;00:00, 4.21kB/s]"
          }
        },
        "67828cfaca584088ba64c689d832c868": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "bde4143bf0a344db861c061730c60c82": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "0aa5cacdf0174a8bbb19e45916d56c7f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "d7a4ae0c5975478ab76ac3ba5762e328": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "48154f023f0f49df8d5e7cd2423d2f42": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "ea1dc43ac9d4431aaed4b52ca646d5c2": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "efce65018165401f8ba90cbbfab81b7f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "57839b3f74724901ad612b120d34ad0b": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_bddb067262c2492a8c78d933fa424495",
              "IPY_MODEL_04673bad339843a58afe7f64388d139a",
              "IPY_MODEL_17817ca265864db6aac8af3213dadc5a"
            ],
            "layout": "IPY_MODEL_e176b1c2564f47f99b256fd1ef0ab97d"
          }
        },
        "bddb067262c2492a8c78d933fa424495": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_d27c99deae644992b43d30602dea8dc1",
            "placeholder": "​",
            "style": "IPY_MODEL_08c1378302de4777ae519153513c1525",
            "value": "config.json: 100%"
          }
        },
        "04673bad339843a58afe7f64388d139a": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_517a18d2b0c44405a4c873068eea0dcf",
            "max": 998,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_689d5316c5c44e0dbe0b5a09914a46cf",
            "value": 998
          }
        },
        "17817ca265864db6aac8af3213dadc5a": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_7f36764850e4446ab1fff6a3f7ceeca5",
            "placeholder": "​",
            "style": "IPY_MODEL_0a6dfae2d40247de8e3150b2a1c533e3",
            "value": " 998/998 [00:00&lt;00:00, 77.4kB/s]"
          }
        },
        "e176b1c2564f47f99b256fd1ef0ab97d": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "d27c99deae644992b43d30602dea8dc1": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "08c1378302de4777ae519153513c1525": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "517a18d2b0c44405a4c873068eea0dcf": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "689d5316c5c44e0dbe0b5a09914a46cf": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "7f36764850e4446ab1fff6a3f7ceeca5": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "0a6dfae2d40247de8e3150b2a1c533e3": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "e22ec5f7451e4b4686671ffef79a87c1": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_872b05d5c9d74d28a474452de7f3d226",
              "IPY_MODEL_2abec01e88684f5da5bfda65e4a8578d",
              "IPY_MODEL_cf1feaf2d70e4be09f699d68e3d82774"
            ],
            "layout": "IPY_MODEL_7a9108ef7ab14041a9880380c9cbcebf"
          }
        },
        "872b05d5c9d74d28a474452de7f3d226": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_e44ec3e6c2bc4c2ea928ffabd7ae8e2a",
            "placeholder": "​",
            "style": "IPY_MODEL_87f6ded0498b4f17a2611275abac4d2c",
            "value": "pytorch_model.bin: 100%"
          }
        },
        "2abec01e88684f5da5bfda65e4a8578d": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_d6ff492bdc3a48a9ba0143616f1e6e12",
            "max": 409138989,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_98eb3f43641a4279b5fa4e39820b91bb",
            "value": 409138989
          }
        },
        "cf1feaf2d70e4be09f699d68e3d82774": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_feadf72a9eea4497a7c8d0c2ea6d142b",
            "placeholder": "​",
            "style": "IPY_MODEL_b2b7b167f5734d0fa1ea15c3718f6fe2",
            "value": " 409M/409M [00:06&lt;00:00, 47.5MB/s]"
          }
        },
        "7a9108ef7ab14041a9880380c9cbcebf": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "e44ec3e6c2bc4c2ea928ffabd7ae8e2a": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
           
Download .txt
gitextract_diif25g8/

├── .dockerignore
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── 1_bug-report.yml
│   │   ├── 2_feature-request.yml
│   │   ├── 3_documentation.yml
│   │   └── config.yml
│   └── workflows/
│       ├── basic_check.yml
│       ├── build_docker_image.yml
│       └── sync_files.yml
├── .gitignore
├── .pre-commit-config.yaml
├── Cookbook/
│   ├── CHANGELOG.md
│   ├── CONTRIBUTING.md
│   ├── CONTRIBUTING_cn.md
│   ├── README.md
│   ├── README_cn.md
│   ├── cn/
│   │   ├── api/
│   │   │   ├── function_calling/
│   │   │   │   └── function_calling_llamaindex.ipynb
│   │   │   └── rag/
│   │   │       ├── yi_rag_langchain.ipynb
│   │   │       └── yi_rag_llamaindex.ipynb
│   │   ├── ecosystem/
│   │   │   ├── yi-vl最佳实践.md
│   │   │   ├── 使用Yi大模型玩转街霸三.md
│   │   │   ├── 基于LlamaIndex和Yi-large构建智能问答系统.md
│   │   │   ├── 基于yi-large构建思维导图生成器.md
│   │   │   └── 强化Yi-1.5-6B-Chat的数学和逻辑能力.md
│   │   └── opensource/
│   │       ├── Inference/
│   │       │   ├── Inference_using_lmdeploy.ipynb
│   │       │   ├── Inference_using_swift.ipynb
│   │       │   ├── Inference_using_transformers.ipynb
│   │       │   └── vLLM_Inference_tutorial.ipynb
│   │       ├── fine_tune/
│   │       │   ├── finetune-yi-with-llamafactory.md
│   │       │   └── finetune-yi-with-swift.md
│   │       ├── function_calling/
│   │       │   ├── function_calling.ipynb
│   │       │   └── function_calling_llamaindex.ipynb
│   │       ├── local/
│   │       │   ├── local-llama.cpp.md
│   │       │   ├── local-lm-studio.md
│   │       │   ├── local-mlx.md
│   │       │   └── local-ollama.md
│   │       ├── quantization/
│   │       │   ├── autoawq-yi-quantization.md
│   │       │   ├── autogptq-yi-quantization.md
│   │       │   └── swift-yi-quantization.md
│   │       └── rag/
│   │           ├── yi_rag_langchain.ipynb
│   │           └── yi_rag_llamaindex.ipynb
│   └── en/
│       ├── api/
│       │   ├── function_calling/
│       │   │   └── function_calling_llamaindex.ipynb
│       │   └── rag/
│       │       ├── yi_rag_langchain.ipynb
│       │       └── yi_rag_llamaindex.ipynb
│       ├── ecosystem/
│       │   ├── Building_a_Mind_Map_Generator_Powered_by_Yi-Large.md
│       │   ├── Building_an_Intelligent_Q&A_System_Based_on_LlamaIndex_and_Yi-large.md
│       │   ├── Enhancing_the_Mathematical_and_Logical_Reasoning_Abilities_of_Yi-1.5-6B-Chat.md
│       │   ├── Mastering_Street_Fighter_III_with_the_Yi_Language_Model.md
│       │   └── yi-vl-best-practice.md
│       └── opensource/
│           ├── Inference/
│           │   ├── Inference_using_lmdeploy.ipynb
│           │   ├── Inference_using_swift.ipynb
│           │   ├── Inference_using_transformers.ipynb
│           │   └── vLLM_Inference_tutorial.ipynb
│           ├── fine_tune/
│           │   ├── finetune-yi-with-llamafactory.md
│           │   └── finetune-yi-with-swift.md
│           ├── function_calling/
│           │   ├── function_calling.ipynb
│           │   └── function_calling_llamaindex.ipynb
│           ├── local/
│           │   ├── local-llama.cpp.md
│           │   ├── local-lm-studio.md
│           │   ├── local-mlx.md
│           │   └── local-ollama.md
│           ├── quantization/
│           │   ├── autoawq-yi-quantization.md
│           │   ├── autogptq-yi-quantization.md
│           │   └── swift-yi-quantization.md
│           └── rag/
│               ├── yi_rag_langchain.ipynb
│               └── yi_rag_llamaindex.ipynb
├── Dockerfile
├── Events/
│   └── readme.md
├── HUGGINGFACE_README.md
├── LICENSE
├── MODEL_LICENSE_AGREEMENT.txt
├── NOTICE
├── README/
│   ├── huggingface_header.md
│   ├── modelscope_header.md
│   └── wisemodel_header.md
├── README.md
├── README_CN.md
├── VL/
│   ├── README.md
│   ├── cli.py
│   ├── llava/
│   │   ├── __init__.py
│   │   ├── conversation.py
│   │   ├── mm_utils.py
│   │   └── model/
│   │       ├── __init__.py
│   │       ├── clip_encoder/
│   │       │   ├── builder.py
│   │       │   └── clip_encoder.py
│   │       ├── constants.py
│   │       ├── llava_arch.py
│   │       ├── llava_llama.py
│   │       └── multimodal_projector/
│   │           └── builder.py
│   ├── openai_api.py
│   ├── requirements.txt
│   ├── single_inference.py
│   └── web_demo.py
├── assets/
│   └── img/
│       ├── coder/
│       │   └── test
│       └── events/
│           └── 1
├── conda-lock.yml
├── demo/
│   ├── README.md
│   ├── text_generation.py
│   ├── text_generation_tp.py
│   └── web_demo.py
├── docs/
│   └── README_llama.cpp.md
├── finetune/
│   ├── README.md
│   ├── README_CN.md
│   ├── constant.py
│   ├── scripts/
│   │   ├── run_eval.sh
│   │   ├── run_sft_Yi_34b.sh
│   │   ├── run_sft_Yi_6b.sh
│   │   └── run_sft_lora_Yi_6b.sh
│   ├── sft/
│   │   ├── main.py
│   │   └── prompt_eval.py
│   ├── utils/
│   │   ├── data/
│   │   │   ├── data_utils.py
│   │   │   └── raw_datasets.py
│   │   ├── ds_utils.py
│   │   ├── model/
│   │   │   └── model_utils.py
│   │   ├── module/
│   │   │   └── lora.py
│   │   ├── perf.py
│   │   └── utils.py
│   └── yi_example_dataset/
│       └── data/
│           ├── eval.jsonl
│           └── train.jsonl
├── pyproject.toml
├── quantization/
│   ├── awq/
│   │   ├── README.md
│   │   ├── eval_quantized_model.py
│   │   └── quant_autoawq.py
│   └── gptq/
│       ├── README.md
│       ├── eval_quantized_model.py
│       └── quant_autogptq.py
└── requirements.txt
Download .txt
SYMBOL INDEX (204 symbols across 27 files)

FILE: VL/cli.py
  function load_image (line 17) | def load_image(image_file):
  function main (line 22) | def main(args):

FILE: VL/llava/conversation.py
  class SeparatorStyle (line 6) | class SeparatorStyle(Enum):
  class Conversation (line 13) | class Conversation:
    method get_prompt (line 27) | def get_prompt(self):
    method append_message (line 56) | def append_message(self, role, message):
    method get_images (line 59) | def get_images(self, return_pil=False):
    method to_gradio_chatbot (line 118) | def to_gradio_chatbot(self):
    method copy (line 150) | def copy(self):
    method dict (line 162) | def dict(self):

FILE: VL/llava/mm_utils.py
  function load_image_from_base64 (line 11) | def load_image_from_base64(image):
  function process_images (line 15) | def process_images(images, image_processor, model_cfg):
  function expand2square (line 19) | def expand2square(pil_img, background_color):
  function tokenizer_image_token (line 33) | def tokenizer_image_token(
  function get_model_name_from_path (line 63) | def get_model_name_from_path(model_path):
  function load_pretrained_model (line 72) | def load_pretrained_model(
  class KeywordsStoppingCriteria (line 99) | class KeywordsStoppingCriteria(StoppingCriteria):
    method __init__ (line 100) | def __init__(self, keywords, tokenizer, input_ids):
    method __call__ (line 106) | def __call__(

FILE: VL/llava/model/clip_encoder/builder.py
  function build_vision_tower (line 4) | def build_vision_tower(vision_tower_cfg, **kwargs):

FILE: VL/llava/model/clip_encoder/clip_encoder.py
  class CLIPVisionTower (line 6) | class CLIPVisionTower(nn.Module):
    method __init__ (line 7) | def __init__(self, vision_tower, args, delay_load=False):
    method load_model (line 21) | def load_model(self):
    method feature_select (line 31) | def feature_select(self, image_forward_outs):
    method forward (line 42) | def forward(self, images):
    method dummy_feature (line 62) | def dummy_feature(self):
    method dtype (line 66) | def dtype(self):
    method device (line 70) | def device(self):
    method config (line 74) | def config(self):
    method hidden_size (line 81) | def hidden_size(self):
    method num_patches (line 85) | def num_patches(self):

FILE: VL/llava/model/llava_arch.py
  class LlavaMetaModel (line 26) | class LlavaMetaModel:
    method __init__ (line 27) | def __init__(self, config):
    method get_vision_tower (line 37) | def get_vision_tower(self):
    method initialize_vision_modules (line 43) | def initialize_vision_modules(self, model_args):
  class LlavaMetaForCausalLM (line 87) | class LlavaMetaForCausalLM(ABC):
    method get_model (line 89) | def get_model(self):
    method get_vision_tower (line 92) | def get_vision_tower(self):
    method encode_images (line 95) | def encode_images(self, images):
    method prepare_inputs_labels_for_multimodal (line 100) | def prepare_inputs_labels_for_multimodal(
    method initialize_vision_tokenizer (line 333) | def initialize_vision_tokenizer(self, model_args, tokenizer):

FILE: VL/llava/model/llava_llama.py
  class LlavaConfig (line 27) | class LlavaConfig(LlamaConfig):
  class LlavaLlamaModel (line 31) | class LlavaLlamaModel(LlavaMetaModel, LlamaModel):
    method __init__ (line 34) | def __init__(self, config: LlamaConfig):
  class LlavaLlamaForCausalLM (line 39) | class LlavaLlamaForCausalLM(LlamaForCausalLM, LlavaMetaForCausalLM):
    method __init__ (line 42) | def __init__(self, config):
    method get_model (line 51) | def get_model(self):
    method forward (line 54) | def forward(
    method prepare_inputs_for_generation (line 137) | def prepare_inputs_for_generation(

FILE: VL/llava/model/multimodal_projector/builder.py
  class IdentityMap (line 6) | class IdentityMap(nn.Module):
    method __init__ (line 7) | def __init__(self):
    method forward (line 10) | def forward(self, x, *args, **kwargs):
    method config (line 14) | def config(self):
  class SimpleResBlock (line 18) | class SimpleResBlock(nn.Module):
    method __init__ (line 19) | def __init__(self, channels):
    method forward (line 27) | def forward(self, x):
  function build_vision_projector (line 32) | def build_vision_projector(config, delay_load=False, **kwargs):

FILE: VL/openai_api.py
  class Role (line 66) | class Role(str, Enum):
  class ErrorResponse (line 74) | class ErrorResponse(BaseModel):
  class ErrorCode (line 80) | class ErrorCode(IntEnum):
  class ChatCompletionCreateParams (line 107) | class ChatCompletionCreateParams(BaseModel):
  function torch_gc (line 266) | def torch_gc() -> None:
  function lifespan (line 277) | async def lifespan(app: FastAPI):  # collects GPU memory
  function create_chat_completion (line 294) | async def create_chat_completion(
  function generate_stream (line 341) | def generate_stream(
  class DefaultEngine (line 442) | class DefaultEngine(ABC):
    method __init__ (line 445) | def __init__(
    method _prepare_for_generate (line 472) | def _prepare_for_generate(self) -> None:
    method convert_to_inputs (line 485) | def convert_to_inputs(
    method _generate (line 552) | def _generate(self, params: Dict[str, Any]) -> Iterator[dict]:
    method _create_chat_completion_stream (line 590) | def _create_chat_completion_stream(
    method _create_chat_completion (line 660) | def _create_chat_completion(
    method create_chat_completion (line 702) | def create_chat_completion(
    method stop (line 716) | def stop(self):
  class YiAITemplate (line 726) | class YiAITemplate(ABC):
    method apply_chat_template (line 743) | def apply_chat_template(
    method template (line 769) | def template(self) -> str:
    method postprocess_messages (line 779) | def postprocess_messages(
    method parse_assistant_response (line 784) | def parse_assistant_response(
  function _compile_jinja_template (line 791) | def _compile_jinja_template(chat_template: str):
  function handle_request (line 816) | async def handle_request(
  function check_requests (line 843) | def check_requests(
  function create_error_response (line 886) | def create_error_response(code: int, message: str) -> JSONResponse:
  function get_event_publisher (line 892) | async def get_event_publisher(
  function create_generate_model (line 920) | def create_generate_model(args):
  function model_json (line 939) | def model_json(model: pydantic.BaseModel, **kwargs) -> str:
  function model_dump (line 945) | def model_dump(model: pydantic.BaseModel, **kwargs) -> Dict[str, Any]:
  function model_parse (line 954) | def model_parse(model: Type[pydantic.BaseModel], data: Any) -> pydantic....
  function get_context_length (line 973) | def get_context_length(config) -> int:
  function apply_stopping_strings (line 984) | def apply_stopping_strings(reply: str, stop_strings: List[str]) -> Tuple...
  function _get_args (line 1016) | def _get_args():

FILE: VL/single_inference.py
  function disable_torch_init (line 17) | def disable_torch_init():
  function single_infer (line 27) | def single_infer(args):

FILE: VL/web_demo.py
  function load_model_tokenizer_processor (line 24) | def load_model_tokenizer_processor(args):
  function _parse_text (line 33) | def _parse_text(text):
  function launch_demo (line 84) | def launch_demo(args, yi_model, tokenizer, image_processor):
  function main (line 294) | def main(args):

FILE: demo/text_generation.py
  function parse_inputs (line 6) | def parse_inputs():
  function main (line 36) | def main(args):

FILE: demo/text_generation_tp.py
  function parse_inputs (line 11) | def parse_inputs():
  function main (line 54) | def main(args):

FILE: demo/web_demo.py
  class StopOnTokens (line 17) | class StopOnTokens(StoppingCriteria):
    method __call__ (line 18) | def __call__(
  function parse_text (line 30) | def parse_text(text):
  function predict (line 62) | def predict(history, max_length, top_p, temperature):
  function main (line 100) | def main(args):

FILE: finetune/sft/main.py
  function parse_args (line 45) | def parse_args():
  function main (line 220) | def main():

FILE: finetune/sft/prompt_eval.py
  function parse_args (line 18) | def parse_args():
  function generate (line 78) | def generate(
  function print_utils (line 102) | def print_utils(gen_output):
  function prompt_eval (line 109) | def prompt_eval(args, model_baseline, model_fintuned, tokenizer, device,...
  function main (line 139) | def main():

FILE: finetune/utils/data/data_utils.py
  function get_raw_dataset (line 20) | def get_raw_dataset(dataset_name, output_path, seed, local_rank):
  function get_shuffle_idx (line 67) | def get_shuffle_idx(seed, size):
  function get_raw_dataset_split_index (line 77) | def get_raw_dataset_split_index(
  class PromptDataset (line 114) | class PromptDataset(Dataset):
    method __init__ (line 115) | def __init__(
    method __len__ (line 125) | def __len__(self):
    method __getitem__ (line 129) | def __getitem__(self, idx):
  function create_dataset_split (line 138) | def create_dataset_split(
  function create_dataset (line 184) | def create_dataset(
  function create_prompt_dataset (line 248) | def create_prompt_dataset(
  class DataCollatorReward (line 359) | class DataCollatorReward:
    method __call__ (line 360) | def __call__(self, data):
  class DataCollatorRLHF (line 371) | class DataCollatorRLHF:
    method __init__ (line 372) | def __init__(self, max_token_len, inference_tp_size):
    method __call__ (line 376) | def __call__(self, data):
  function get_unsupervised_data (line 405) | def get_unsupervised_data(args, tokenizer):
  class MiniDataset (line 455) | class MiniDataset:
    method __init__ (line 456) | def __init__(self, max_size, small_batch_size):
    method seperate (line 461) | def seperate(self):
    method add (line 488) | def add(self, data):
    method free (line 500) | def free(self):

FILE: finetune/utils/data/raw_datasets.py
  class PromptRawDataset (line 7) | class PromptRawDataset(object):
    method __init__ (line 8) | def __init__(self, output_path, seed, local_rank, dataset_name):
    method get_train_data (line 14) | def get_train_data(self):
    method get_eval_data (line 17) | def get_eval_data(self):
    method get_prompt (line 21) | def get_prompt(self, sample):
    method get_chosen (line 25) | def get_chosen(self, sample):
    method get_rejected (line 30) | def get_rejected(self, sample):
    method get_prompt_and_chosen (line 33) | def get_prompt_and_chosen(self, sample):
    method get_prompt_and_rejected (line 36) | def get_prompt_and_rejected(self, sample):
  class DahoasRmstaticDataset (line 41) | class DahoasRmstaticDataset(PromptRawDataset):
    method __init__ (line 42) | def __init__(self, output_path, seed, local_rank, dataset_name):
    method get_train_data (line 59) | def get_train_data(self):
    method get_eval_data (line 62) | def get_eval_data(self):
    method get_prompt (line 65) | def get_prompt(self, sample):
    method get_chosen (line 68) | def get_chosen(self, sample):
    method get_rejected (line 71) | def get_rejected(self, sample):
    method get_prompt_and_chosen (line 74) | def get_prompt_and_chosen(self, sample):
    method get_prompt_and_rejected (line 77) | def get_prompt_and_rejected(self, sample):
  class LocalJsonFileDataset (line 81) | class LocalJsonFileDataset(PromptRawDataset):
    method __init__ (line 82) | def __init__(self, output_path, seed, local_rank, dataset_name, chat_p...
    method get_train_data (line 94) | def get_train_data(self):
    method get_eval_data (line 99) | def get_eval_data(self):
    method get_prompt (line 105) | def get_prompt(self, sample):
    method get_chosen (line 111) | def get_chosen(self, sample):
    method get_rejected (line 118) | def get_rejected(self, sample):
    method get_prompt_and_chosen (line 123) | def get_prompt_and_chosen(self, sample):
    method get_prompt_and_rejected (line 128) | def get_prompt_and_rejected(self, sample):
  class YiDataset (line 134) | class YiDataset(PromptRawDataset):
    method __init__ (line 135) | def __init__(self, output_path, seed, local_rank, dataset_name, chat_p...
    method get_train_data (line 148) | def get_train_data(self):
    method get_eval_data (line 153) | def get_eval_data(self):
    method get_prompt (line 158) | def get_prompt(self, sample):
    method get_prompt_and_chosen (line 163) | def get_prompt_and_chosen(self, sample):

FILE: finetune/utils/ds_utils.py
  function get_train_ds_config (line 8) | def get_train_ds_config(
  function get_eval_ds_config (line 61) | def get_eval_ds_config(offload, stage=0):

FILE: finetune/utils/model/model_utils.py
  function create_hf_model (line 7) | def create_hf_model(

FILE: finetune/utils/module/lora.py
  class LinearLayer_LoRA (line 10) | class LinearLayer_LoRA(nn.Module):
    method __init__ (line 13) | def __init__(self, weight, lora_dim=0, lora_scaling=1, lora_droppout=0...
    method eval (line 45) | def eval(self):
    method train (line 50) | def train(self, mode=True):
    method reset_parameters (line 54) | def reset_parameters(self):
    method fuse_lora_weight (line 58) | def fuse_lora_weight(self):
    method unfuse_lora_weight (line 65) | def unfuse_lora_weight(self):
    method forward (line 72) | def forward(self, input):
  function convert_linear_layer_to_lora (line 88) | def convert_linear_layer_to_lora(
  function _z3_params_to_fetch (line 108) | def _z3_params_to_fetch(param_list):
  function convert_lora_to_linear_layer (line 119) | def convert_lora_to_linear_layer(model):
  function only_optimize_lora_parameters (line 143) | def only_optimize_lora_parameters(model):
  function make_model_gradient_checkpointing_compatible (line 153) | def make_model_gradient_checkpointing_compatible(model):

FILE: finetune/utils/perf.py
  function print_throughput (line 5) | def print_throughput(hf_model, args, e2e_time, rank=0):
  function calculate_flops (line 45) | def calculate_flops(checkpoint_activations_factor, batch_size, seq_lengt...
  function get_hf_configs (line 63) | def get_hf_configs(hf_config):

FILE: finetune/utils/utils.py
  function print_rank_0 (line 11) | def print_rank_0(msg, rank=0):
  function to_device (line 16) | def to_device(batch, device):
  class MovingAverage (line 27) | class MovingAverage:
    method __init__ (line 28) | def __init__(self):
    method update (line 33) | def update(self, num):
  function get_tokenizer (line 41) | def get_tokenizer(model_name_or_path, fast_tokenizer=False):
  function load_hf_tokenizer (line 51) | def load_hf_tokenizer(model_name_or_path, fast_tokenizer=False):
  function save_hf_format (line 68) | def save_hf_format(model, tokenizer, args, sub_folder=""):
  function get_all_reduce_mean (line 93) | def get_all_reduce_mean(tensor):
  function load_state_dict_into_model (line 102) | def load_state_dict_into_model(
  function get_optimizer_grouped_parameters (line 156) | def get_optimizer_grouped_parameters(
  function _z3_params_to_fetch (line 203) | def _z3_params_to_fetch(param_list):
  function moving_average (line 211) | def moving_average(model, model_ema, beta=0.992, device=None, zero_stage...
  function save_zero_three_model (line 229) | def save_zero_three_model(model_ema, global_rank, save_dir, zero_stage=0):

FILE: quantization/awq/eval_quantized_model.py
  function run_quantization (line 5) | def run_quantization(args):

FILE: quantization/awq/quant_autoawq.py
  function run_quantization (line 8) | def run_quantization(args):

FILE: quantization/gptq/eval_quantized_model.py
  function run_quantization (line 4) | def run_quantization(args):

FILE: quantization/gptq/quant_autogptq.py
  function run_quantization (line 7) | def run_quantization(args):
Condensed preview — 126 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,536K chars).
[
  {
    "path": ".dockerignore",
    "chars": 19,
    "preview": ".git/\n.venv/\nvenv/\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/1_bug-report.yml",
    "chars": 1902,
    "preview": "name: 🐞 Bug report\ndescription: \"Problems encountered while utilizing Yi model\"\ntitle: \"Title \"\nlabels: [\"type/bug-repor"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/2_feature-request.yml",
    "chars": 1479,
    "preview": "name: 🚀 Feature request\ndescription: \"Add new feature, improve code, and more\"\ntitle: \"Features \"\nlabels: [\"type/feature"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/3_documentation.yml",
    "chars": 1429,
    "preview": "name: 📚 Document\ndescription: Suggest document changes\ntitle: \"Doc\"\nlabels: [\"doc-required\"]\nbody:\n  - type: markdown\n  "
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "chars": 193,
    "preview": "blank_issues_enabled: false\n\ncontact_links:\n  - name: 💬 Ask a question or get support\n    url: https://github.com/01-ai/"
  },
  {
    "path": ".github/workflows/basic_check.yml",
    "chars": 985,
    "preview": "name: Basic Check\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n    branches:\n      - main\n\nconcurrency:\n  gro"
  },
  {
    "path": ".github/workflows/build_docker_image.yml",
    "chars": 4319,
    "preview": "name: Build Docker Image\n\non:\n  workflow_dispatch:\n  push:\n    tags:\n      - '*.*.*'\n\nconcurrency:\n  group: ${{ github.w"
  },
  {
    "path": ".github/workflows/sync_files.yml",
    "chars": 3015,
    "preview": "name: Sync Files\n\non:\n  push:\n    branches:\n      - main\n\nenv:\n  GIT_CLONE_PROTECTION_ACTIVE: false\n\njobs:\n  detect-chan"
  },
  {
    "path": ".gitignore",
    "chars": 3203,
    "preview": ".idea/*\n.vscode/*\n\n# Local History for Visual Studio Code\n.history/\n\n# Built Visual Studio Code Extensions\n*.vsix\n\n# Byt"
  },
  {
    "path": ".pre-commit-config.yaml",
    "chars": 784,
    "preview": "repos:\n  - repo: https://github.com/psf/black\n    rev: 23.7.0\n    hooks:\n      - id: black\n        # It is recommended t"
  },
  {
    "path": "Cookbook/CHANGELOG.md",
    "chars": 16,
    "preview": "```\n记录版本变化 \n```\n"
  },
  {
    "path": "Cookbook/CONTRIBUTING.md",
    "chars": 1067,
    "preview": "# Contributing Guide\n\nWe appreciate your interest in contributing to our repository! To ensure a smooth and efficient pr"
  },
  {
    "path": "Cookbook/CONTRIBUTING_cn.md",
    "chars": 432,
    "preview": "# 贡献指南\n\n感谢你对我们仓库的贡献兴趣!为确保流程顺利高效,请遵循以下指南。\n\n## 格式\n\n- **Notebook**:Jupyter Notebook (.ipynb)\n- **Markdown**:Markdown 文件 (.m"
  },
  {
    "path": "Cookbook/README.md",
    "chars": 8885,
    "preview": "# 👋 Yi Cookbook\n\n<p align=\"center\">\n  <a href=\"./README_cn.md\">Chinese</a> | English\n</p>\n\nWelcome to the Yi Cookbook! T"
  },
  {
    "path": "Cookbook/README_cn.md",
    "chars": 5905,
    "preview": "# 👋 Yi Cookbook\n\n<p align=\"center\">\n  <a href=\"./README.md\">English</a> | 中文\n</p>\n\n欢迎来到 Yi Cookbook!这是一个关于 Yi 模型的综合资源库,包"
  },
  {
    "path": "Cookbook/cn/api/function_calling/function_calling_llamaindex.ipynb",
    "chars": 4164,
    "preview": "{\"nbformat\":4,\"nbformat_minor\":0,\"metadata\":{\"colab\":{\"provenance\":[],\"authorship_tag\":\"ABX9TyPi5Ho7I9ICMU0Jnn+/aVjA\"},\""
  },
  {
    "path": "Cookbook/cn/api/rag/yi_rag_langchain.ipynb",
    "chars": 4667,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 使用Yi的API构建RAG(LangChain)\\n\",\n    "
  },
  {
    "path": "Cookbook/cn/api/rag/yi_rag_llamaindex.ipynb",
    "chars": 223515,
    "preview": "{\n  \"cells\": [\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"SweINiRd8dLd\"\n      },\n      \"sou"
  },
  {
    "path": "Cookbook/cn/ecosystem/yi-vl最佳实践.md",
    "chars": 5255,
    "preview": "\n# Yi-VL 最佳实践\n\n## 目录\n- [环境准备](#环境准备)\n- [推理](#推理)\n- [微调](#微调)\n- [微调后推理](#微调后推理)\n\n## 声明\n\n本文章作者为 swift 成员 Jintao Huang。\n\n原文"
  },
  {
    "path": "Cookbook/cn/ecosystem/使用Yi大模型玩转街霸三.md",
    "chars": 2242,
    "preview": "# 使用Yi大模型玩转街霸三:从安装到应用的详细指南\n\n## 引言\n\n欢迎来到这篇详细的教学指南!在本文中,我们将探索如何使用Yi大模型(特别是yi-large模型)来玩转经典格斗游戏街霸三。这个有趣的项目将展示大语言模型(LLM)在游戏A"
  },
  {
    "path": "Cookbook/cn/ecosystem/基于LlamaIndex和Yi-large构建智能问答系统.md",
    "chars": 3925,
    "preview": "# 「Yi x LlamaIndex」基于LlamaIndex和Yi-large构建融合网络与本地知识的智能问答系统\n\n## 1. 引言\n\n在人工智能迅猛发展的今天,大语言模型(LLM)已成为众多应用的核心。然而,LLM 也面临诸如信息可能"
  },
  {
    "path": "Cookbook/cn/ecosystem/基于yi-large构建思维导图生成器.md",
    "chars": 14394,
    "preview": "# 使用Yi的yi-large模型构建PDF上传和思维导图生成应用教程\n\n## 目录\n1. [简介](#简介)\n2. [环境准备](#环境准备)\n3. [安装必要的库](#安装必要的库)\n4. [创建项目结构](#创建项目结构)\n5. [编"
  },
  {
    "path": "Cookbook/cn/ecosystem/强化Yi-1.5-6B-Chat的数学和逻辑能力.md",
    "chars": 4251,
    "preview": "# 强化Yi-1.5-6B-Chat的数学和逻辑能力\n\n## 目录\n1. [简介](#简介)\n2. [环境准备](#环境准备)\n3. [安装SWIFT](#安装swift)\n4. [数据集准备](#数据集准备)\n5. [模型微调](#模型微"
  },
  {
    "path": "Cookbook/cn/opensource/Inference/Inference_using_lmdeploy.ipynb",
    "chars": 1923,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 使用lmdeploy进行Yi-1.5-6B-Chat模型的推理\\n"
  },
  {
    "path": "Cookbook/cn/opensource/Inference/Inference_using_swift.ipynb",
    "chars": 4027,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 使用 SWIFT 进行推理\\n\",\n    \"\\n\",\n    \""
  },
  {
    "path": "Cookbook/cn/opensource/Inference/Inference_using_transformers.ipynb",
    "chars": 29344,
    "preview": "{\n  \"cells\": [\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"xvxe3WD8zpPf\"\n      },\n      \"sou"
  },
  {
    "path": "Cookbook/cn/opensource/Inference/vLLM_Inference_tutorial.ipynb",
    "chars": 3375,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# 使用vLLM进行Yi-1.5-6B-Chat模型的推理\\n\",\n "
  },
  {
    "path": "Cookbook/cn/opensource/fine_tune/finetune-yi-with-llamafactory.md",
    "chars": 2371,
    "preview": "### 🌟使用LLaMA-Factory微调\n\nLLaMA Factory是一款开源低代码大模型微调框架,集成了业界广泛使用的微调技术,是北航的博士生郑耀威的杰作。微调的过程很方便,跟着我们一步一步来!\n\n#### 安装\n\n首先我们拉取LL"
  },
  {
    "path": "Cookbook/cn/opensource/fine_tune/finetune-yi-with-swift.md",
    "chars": 602,
    "preview": "### 🌟使用SWIFT微调\nSWIFT是ModelScope开源的一款框架,支持多模态大模型的训练、推理、评测和部署。并且可以直接实现模型训练评测到应用的完整链路。\n接下来我们就开始使用SWIFT对Yi模型进行微调!\n\n#### 安装\n\n"
  },
  {
    "path": "Cookbook/cn/opensource/function_calling/function_calling.ipynb",
    "chars": 7049,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 🌟动手实践function call\\n\",\n    \"\\n\","
  },
  {
    "path": "Cookbook/cn/opensource/function_calling/function_calling_llamaindex.ipynb",
    "chars": 4354,
    "preview": "{\"nbformat\":4,\"nbformat_minor\":0,\"metadata\":{\"colab\":{\"provenance\":[],\"authorship_tag\":\"ABX9TyORfgxDEFPG125uYS1AUVbE\"},\""
  },
  {
    "path": "Cookbook/cn/opensource/local/local-llama.cpp.md",
    "chars": 5189,
    "preview": "### 🌟使用llama.cpp本地运行\n\nllama.cpp是在各种硬件(本地和云端)上以最少的设置和最先进的性能实现 LLM 推理。llama.cpp是由C++编写而成。我们也可以在llama.cpp中使用Yi系列的GGUF格式的模型。"
  },
  {
    "path": "Cookbook/cn/opensource/local/local-lm-studio.md",
    "chars": 461,
    "preview": "### 🌟使用LM Studio本地运行\n\nLM Studio 是一款易于使用的桌面应用程序,用于试用本地和开源的大型语言模型 (LLM),能更好的在本地部署大模型,并且操作相对简单。\n\n#### 下载和安装\n\nLM Studio的安装非常"
  },
  {
    "path": "Cookbook/cn/opensource/local/local-mlx.md",
    "chars": 508,
    "preview": "### 🌟使用MLX-LM本地运行\n\nMLX-LM是一款适用Mac os进行本地部署大模型的框架,具体内容参考[官方文档](https://github.com/ml-explore/mlx-examples/tree/main?tab=r"
  },
  {
    "path": "Cookbook/cn/opensource/local/local-ollama.md",
    "chars": 1354,
    "preview": "### 🌟使用ollama本地运行\n\nollama是一个开源的大型语言模型服务工具,它允许用户在自己的硬件环境中轻松部署和使用大规模预训练模型。使得用户能够快速地在本地运行这些模型。\n\n#### 下载和安装\n\n可以直接在ollama[官方网"
  },
  {
    "path": "Cookbook/cn/opensource/quantization/autoawq-yi-quantization.md",
    "chars": 2519,
    "preview": "### 🌟使用AutoAWQ量化\n\nAutoAWQ 是一款易于使用的 4 位量化模型软件包。与 FP16 相比,AutoAWQ 可将模型速度提高 3 倍并将内存需求降低 3 倍。\n\nAutoAWQ 实现了激活感知权重量化 (AWQ) 算法来"
  },
  {
    "path": "Cookbook/cn/opensource/quantization/autogptq-yi-quantization.md",
    "chars": 2431,
    "preview": "### 🌟使用AutoGPTQ量化\n\nAutoGPTQ是一个基于 GPTQ 算法,简单易用且拥有用户友好型接口的大语言模型量化工具包。\n\n我们可以通过AutoGPTQ量化我们的Yi系列模型。\n\n| 模型 | 显存使用 | 硬盘占用 |\n|-"
  },
  {
    "path": "Cookbook/cn/opensource/quantization/swift-yi-quantization.md",
    "chars": 2003,
    "preview": "### 🌟使用SWIFT量化\n\nSWIFT是modelscope开源的一款框架,支持多模态大模型的训练、推理、评测和部署。并且可以直接实现模型训练评测到应用的完整链路。\n\n使用SWIFT量化非常方便,只需要几步即可完成量化,在量化中有许多的"
  },
  {
    "path": "Cookbook/cn/opensource/rag/yi_rag_langchain.ipynb",
    "chars": 372872,
    "preview": "{\n  \"cells\": [\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"s52urpqlDH8p\"\n      },\n      \"sou"
  },
  {
    "path": "Cookbook/cn/opensource/rag/yi_rag_llamaindex.ipynb",
    "chars": 224231,
    "preview": "{\n  \"cells\": [\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"SweINiRd8dLd\"\n      },\n      \"sou"
  },
  {
    "path": "Cookbook/en/api/function_calling/function_calling_llamaindex.ipynb",
    "chars": 6613,
    "preview": "{\n  \"nbformat\": 4,\n  \"nbformat_minor\": 0,\n  \"metadata\": {\n    \"colab\": {\n      \"provenance\": [],\n      \"authorship_tag\":"
  },
  {
    "path": "Cookbook/en/api/rag/yi_rag_langchain.ipynb",
    "chars": 5209,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Building RAG (LangChain) Using Yi"
  },
  {
    "path": "Cookbook/en/api/rag/yi_rag_llamaindex.ipynb",
    "chars": 224379,
    "preview": "{\n  \"cells\": [\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"SweINiRd8dLd\"\n      },\n      \"sou"
  },
  {
    "path": "Cookbook/en/ecosystem/Building_a_Mind_Map_Generator_Powered_by_Yi-Large.md",
    "chars": 17626,
    "preview": "\n# Tutorial: Building a PDF Upload and Mind Map Generation Application Using Yi's yi-large Model\n\n## Table of Contents\n1"
  },
  {
    "path": "Cookbook/en/ecosystem/Building_an_Intelligent_Q&A_System_Based_on_LlamaIndex_and_Yi-large.md",
    "chars": 6971,
    "preview": "\n# 「Yi x LlamaIndex」 Building an Intelligent Q&A System Integrating Network and Local Knowledge Based on LlamaIndex and "
  },
  {
    "path": "Cookbook/en/ecosystem/Enhancing_the_Mathematical_and_Logical_Reasoning_Abilities_of_Yi-1.5-6B-Chat.md",
    "chars": 8720,
    "preview": "# Enhancing Yi-1.5-6B-Chat's Mathematical and Logical Abilities\n\n## Table of Contents\n1. [Introduction](#introduction)\n2"
  },
  {
    "path": "Cookbook/en/ecosystem/Mastering_Street_Fighter_III_with_the_Yi_Language_Model.md",
    "chars": 4641,
    "preview": "\n# Mastering Street Fighter III with Yi Large Language Model\n\n## Introduction\n\nWelcome to this detailed tutorial! In thi"
  },
  {
    "path": "Cookbook/en/ecosystem/yi-vl-best-practice.md",
    "chars": 6513,
    "preview": "# Yi-VL Best Practice\n\n## Table of Contents\n- [Environment Setup](#environment-setup)\n- [Inference](#inference)\n- [Fine-"
  },
  {
    "path": "Cookbook/en/opensource/Inference/Inference_using_lmdeploy.ipynb",
    "chars": 31077,
    "preview": "{\n  \"cells\": [\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"6yPJ1ONIwOnn\"\n      },\n      \"sou"
  },
  {
    "path": "Cookbook/en/opensource/Inference/Inference_using_swift.ipynb",
    "chars": 4191,
    "preview": "{\"cells\":[{\"cell_type\":\"markdown\",\"metadata\":{\"id\":\"LUEkKPO5qaYL\"},\"source\":[\"# Inference with SWIFT\\n\",\"\\n\",\"SWIFT is a"
  },
  {
    "path": "Cookbook/en/opensource/Inference/Inference_using_transformers.ipynb",
    "chars": 8160,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"# Inference with Yi Model Using Tra"
  },
  {
    "path": "Cookbook/en/opensource/Inference/vLLM_Inference_tutorial.ipynb",
    "chars": 188593,
    "preview": "{\n  \"cells\": [\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"7RiatjU_ra0b\"\n      },\n      \"sou"
  },
  {
    "path": "Cookbook/en/opensource/fine_tune/finetune-yi-with-llamafactory.md",
    "chars": 3884,
    "preview": "### 🌟Fine-tuning with LLaMA-Factory\n\nLLaMA Factory is an open-source, low-code framework for fine-tuning large language "
  },
  {
    "path": "Cookbook/en/opensource/fine_tune/finetune-yi-with-swift.md",
    "chars": 1047,
    "preview": "### 🌟Fine-tuning with SWIFT\n\nSWIFT, developed by ModelScope, is a framework designed for training, inferencing, evaluati"
  },
  {
    "path": "Cookbook/en/opensource/function_calling/function_calling.ipynb",
    "chars": 8159,
    "preview": "{\n \"cells\": [\n  {\n   \"cell_type\": \"markdown\",\n   \"metadata\": {},\n   \"source\": [\n    \"## 🌟 Hands-on Practice with Functio"
  },
  {
    "path": "Cookbook/en/opensource/function_calling/function_calling_llamaindex.ipynb",
    "chars": 6815,
    "preview": "{\n  \"nbformat\": 4,\n  \"nbformat_minor\": 0,\n  \"metadata\": {\n    \"colab\": {\n      \"provenance\": [],\n      \"authorship_tag\":"
  },
  {
    "path": "Cookbook/en/opensource/local/local-llama.cpp.md",
    "chars": 6918,
    "preview": "### 🌟Local Running with llama.cpp\n\nllama.cpp implements LLM inference on various hardware (local and cloud) with minimal"
  },
  {
    "path": "Cookbook/en/opensource/local/local-lm-studio.md",
    "chars": 938,
    "preview": "### 🌟Local Running with LM Studio\n\nLM Studio is an easy-to-use desktop application for experimenting with local and open"
  },
  {
    "path": "Cookbook/en/opensource/local/local-mlx.md",
    "chars": 759,
    "preview": "### 🌟Local Running with MLX-LM\n\nMLX-LM is a framework for local deployment of large models on Mac OS. For detailed infor"
  },
  {
    "path": "Cookbook/en/opensource/local/local-ollama.md",
    "chars": 2767,
    "preview": "### 🌟Local Running with ollama\n\nollama is an open-source large language model serving tool that allows users to easily d"
  },
  {
    "path": "Cookbook/en/opensource/quantization/autoawq-yi-quantization.md",
    "chars": 3579,
    "preview": "### 🌟Quantize with AutoAWQ\n\nAutoAWQ is an easy-to-use 4-bit quantization model package. Compared to FP16, AutoAWQ can in"
  },
  {
    "path": "Cookbook/en/opensource/quantization/autogptq-yi-quantization.md",
    "chars": 2978,
    "preview": "### 🌟Quantize with AutoGPTQ\n\nAutoGPTQ is a large language model quantization toolkit based on the GPTQ algorithm, which "
  },
  {
    "path": "Cookbook/en/opensource/quantization/swift-yi-quantization.md",
    "chars": 3287,
    "preview": "### 🌟Quantize with SWIFT\n\nSWIFT is a framework open-sourced by modelscope that supports training, inference, evaluation,"
  },
  {
    "path": "Cookbook/en/opensource/rag/yi_rag_langchain.ipynb",
    "chars": 373406,
    "preview": "{\n  \"cells\": [\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"s52urpqlDH8p\"\n      },\n      \"sou"
  },
  {
    "path": "Cookbook/en/opensource/rag/yi_rag_llamaindex.ipynb",
    "chars": 225409,
    "preview": "{\n  \"cells\": [\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"SweINiRd8dLd\"\n      },\n      \"sou"
  },
  {
    "path": "Dockerfile",
    "chars": 1918,
    "preview": "ARG REGISTRY=\"nvcr.io\"\nARG CUDA_VERSION=\"11.8.0\"\nFROM mambaorg/micromamba:1.5.1 as micromamba\nFROM ${REGISTRY}/nvidia/cu"
  },
  {
    "path": "Events/readme.md",
    "chars": 3407,
    "preview": "# Community Events\n\n\n<p align=\"left\"> \n  <img src=\"https://github.com/01-ai/Yi/blob/main/assets/img/events/down.gif?raw="
  },
  {
    "path": "HUGGINGFACE_README.md",
    "chars": 7152,
    "preview": "---\nlicense: apache-2.0\nwidget:\n  - text: \"There's a place where time stands still. A place of breath taking wonder, but"
  },
  {
    "path": "LICENSE",
    "chars": 11335,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "MODEL_LICENSE_AGREEMENT.txt",
    "chars": 11335,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "NOTICE",
    "chars": 875,
    "preview": "Copyright 2023-2024 01.AI\n\nThis work, [Your Model Name], is based on the work originally authored by 01.AI.\n\nLicensed un"
  },
  {
    "path": "README/huggingface_header.md",
    "chars": 3146,
    "preview": "---\nlicense: apache-2.0\nwidget:\n  - example_title: \"Yi-34B-Chat\"\n    text: \"hi\"\n    output:\n      text: \" Hello! How can"
  },
  {
    "path": "README/modelscope_header.md",
    "chars": 28,
    "preview": "---\nlicense: apache-2.0\n---\n"
  },
  {
    "path": "README/wisemodel_header.md",
    "chars": 80,
    "preview": "---\nlanguage:\n  - en\n  - zh\nlicense: apache-2.0\ntasks:\n  - text-generation\n---\n\n"
  },
  {
    "path": "README.md",
    "chars": 82748,
    "preview": "<p align=\"left\">\n    &nbspEnglish&nbsp | &nbsp; <a href=\"README_CN.md\">中文</a>\n</p>\n<br><br>\n\n<div align=\"center\">\n\n<pict"
  },
  {
    "path": "README_CN.md",
    "chars": 44895,
    "preview": "<p align=\"left\">\n    <a href=\"README.md\">English</a> &nbsp; | &nbsp中文&nbsp</a>\n</p>\n<br><br>\n\n<div align=\"center\">\n\n<pic"
  },
  {
    "path": "VL/README.md",
    "chars": 4337,
    "preview": "# Quick Start\n\n1. Download the Yi-VL model.\n\n   | Model | Download |\n   | --------- | ----------------------------------"
  },
  {
    "path": "VL/cli.py",
    "chars": 3154,
    "preview": "import argparse\nimport os\n\nimport torch\nfrom llava.conversation import conv_templates\nfrom llava.mm_utils import (\n    K"
  },
  {
    "path": "VL/llava/__init__.py",
    "chars": 41,
    "preview": "from .model import LlavaLlamaForCausalLM\n"
  },
  {
    "path": "VL/llava/conversation.py",
    "chars": 7608,
    "preview": "import dataclasses\nfrom enum import Enum, auto\nfrom typing import List\n\n\nclass SeparatorStyle(Enum):\n    \"\"\"Different se"
  },
  {
    "path": "VL/llava/mm_utils.py",
    "chars": 3886,
    "preview": "import base64\nfrom io import BytesIO\n\nimport torch\nfrom llava.model import LlavaLlamaForCausalLM\nfrom llava.model.consta"
  },
  {
    "path": "VL/llava/model/__init__.py",
    "chars": 60,
    "preview": "from .llava_llama import LlavaConfig, LlavaLlamaForCausalLM\n"
  },
  {
    "path": "VL/llava/model/clip_encoder/builder.py",
    "chars": 315,
    "preview": "from .clip_encoder import CLIPVisionTower\n\n\ndef build_vision_tower(vision_tower_cfg, **kwargs):\n    vision_tower = getat"
  },
  {
    "path": "VL/llava/model/clip_encoder/clip_encoder.py",
    "chars": 2789,
    "preview": "import torch\nimport torch.nn as nn\nfrom transformers import CLIPImageProcessor, CLIPVisionConfig, CLIPVisionModel\n\n\nclas"
  },
  {
    "path": "VL/llava/model/constants.py",
    "chars": 140,
    "preview": "# Model Constants\nIGNORE_INDEX = -100\nIMAGE_TOKEN_INDEX = -200\nDEFAULT_IMAGE_TOKEN = \"<image_placeholder>\"\n\nkey_info = {"
  },
  {
    "path": "VL/llava/model/llava_arch.py",
    "chars": 17208,
    "preview": "#    Copyright 2023 Haotian Liu\n#\n#    Licensed under the Apache License, Version 2.0 (the \"License\");\n#    you may not "
  },
  {
    "path": "VL/llava/model/llava_llama.py",
    "chars": 5678,
    "preview": "#    Copyright 2023 Haotian Liu\n#\n#    Licensed under the Apache License, Version 2.0 (the \"License\");\n#    you may not "
  },
  {
    "path": "VL/llava/model/multimodal_projector/builder.py",
    "chars": 1933,
    "preview": "import re\n\nimport torch.nn as nn\n\n\nclass IdentityMap(nn.Module):\n    def __init__(self):\n        super().__init__()\n\n   "
  },
  {
    "path": "VL/openai_api.py",
    "chars": 35496,
    "preview": "# Implements API for Yi-VL in OpenAI's format. (https://platform.openai.com/docs/api-reference/chat)\n# This script benef"
  },
  {
    "path": "VL/requirements.txt",
    "chars": 164,
    "preview": "transformers>=4.36.2\ngradio>=4.13.0\nprotobuf>=4.25.1\ntorch>=2.0.1\nopenai==1.8.0\nuvicorn\nloguru\nsse_starlette\ntorchvision"
  },
  {
    "path": "VL/single_inference.py",
    "chars": 3651,
    "preview": "import argparse\nimport os\n\nimport torch\nfrom llava.conversation import conv_templates\nfrom llava.mm_utils import (\n    K"
  },
  {
    "path": "VL/web_demo.py",
    "chars": 11969,
    "preview": "\"\"\"A simple web interactive chat demo based on gradio.\"\"\"\n\nimport os\nfrom argparse import ArgumentParser\nfrom threading "
  },
  {
    "path": "assets/img/coder/test",
    "chars": 1,
    "preview": "\n"
  },
  {
    "path": "assets/img/events/1",
    "chars": 1,
    "preview": "\n"
  },
  {
    "path": "conda-lock.yml",
    "chars": 81670,
    "preview": "# This lock file was generated by conda-lock (https://github.com/conda/conda-lock). DO NOT EDIT!\n#\n# A \"lock file\" conta"
  },
  {
    "path": "demo/README.md",
    "chars": 747,
    "preview": "# Text Generation Task\n\nTo run text generation task in the streaming mode:\n\n```shell\npython text_generation.py \\\n    --m"
  },
  {
    "path": "demo/text_generation.py",
    "chars": 1884,
    "preview": "import argparse\n\nfrom transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer\n\n\ndef parse_inputs():\n    pa"
  },
  {
    "path": "demo/text_generation_tp.py",
    "chars": 3442,
    "preview": "import argparse\nimport os\n\nimport deepspeed\nimport torch\nfrom deepspeed.module_inject import auto_tp\nfrom torch import d"
  },
  {
    "path": "demo/web_demo.py",
    "chars": 7227,
    "preview": "\"\"\"A simple web interactive chat demo based on gradio.\"\"\"\n\nfrom argparse import ArgumentParser\nfrom threading import Thr"
  },
  {
    "path": "docs/README_llama.cpp.md",
    "chars": 2253,
    "preview": "# Load Yi Series Chat Model with `llama.cpp`\n[`llama.cpp`](https://github.com/ggerganov/llama.cpp) is a library that all"
  },
  {
    "path": "finetune/README.md",
    "chars": 3174,
    "preview": "# Finetune code for Yi 6B and 34B\n\n## Preparation\n\n### From Image\n\nBy default, we use a small dataset from [BAAI/COIG](h"
  },
  {
    "path": "finetune/README_CN.md",
    "chars": 1801,
    "preview": "# Yi-6B及Yi-34B的微调代码\n\n## 准备\n\n### 使用镜像\n\n### 使用本地服务器\n\n推荐使用conda进行开发环境配置,如果您还没有安装conda,参考如下\n\n```bash\nmkdir -p ~/miniconda3\nw"
  },
  {
    "path": "finetune/constant.py",
    "chars": 40,
    "preview": "SFT = 0\nRM = 1\nPPO = 2\nRSFT = 3\nDPO = 4\n"
  },
  {
    "path": "finetune/scripts/run_eval.sh",
    "chars": 200,
    "preview": "#/usr/bin/env bash\n\ncd \"$(dirname \"${BASH_SOURCE[0]}\")/../sft/\"\n\npython prompt_eval.py \\\n\t--model_name_or_path_base=/bas"
  },
  {
    "path": "finetune/scripts/run_sft_Yi_34b.sh",
    "chars": 620,
    "preview": "#/usr/bin/env bash\n\ncd \"$(dirname \"${BASH_SOURCE[0]}\")/../sft/\"\n\nexport CUDA_VISIBLE_DEVICES=0,1,2,3 #limit parallelism "
  },
  {
    "path": "finetune/scripts/run_sft_Yi_6b.sh",
    "chars": 558,
    "preview": "#/usr/bin/env bash\n\ncd \"$(dirname \"${BASH_SOURCE[0]}\")/../sft/\"\n\ndeepspeed main.py \\\n\t--data_path ../yi_example_dataset/"
  },
  {
    "path": "finetune/scripts/run_sft_lora_Yi_6b.sh",
    "chars": 576,
    "preview": "#/usr/bin/env bash\n\ncd ../sft/\n\ndeepspeed main.py \\\n\t--data_path /DATA_PATH/ \\\n\t--model_name_or_path /MODEL_PATH/ \\\n\t--p"
  },
  {
    "path": "finetune/sft/main.py",
    "chars": 13127,
    "preview": "import argparse\nimport math\nimport os\nimport sys\nimport time\n\nimport deepspeed\nimport torch\nfrom deepspeed.ops.adam impo"
  },
  {
    "path": "finetune/sft/prompt_eval.py",
    "chars": 4522,
    "preview": "import argparse\nimport logging\nimport os\nimport sys\n\nimport torch\nfrom transformers import AutoModelForCausalLM\n\nsys.pat"
  },
  {
    "path": "finetune/utils/data/data_utils.py",
    "chars": 17683,
    "preview": "\"\"\"\nPart of the code was adopted from https://github.com/microsoft/Megatron-DeepSpeed/blob/main/megatron/data/dataset_ut"
  },
  {
    "path": "finetune/utils/data/raw_datasets.py",
    "chars": 5813,
    "preview": "# Part of the code is adapted from https://github.com/microsoft/DeepSpeedExamples/blob/master/applications/DeepSpeed-Cha"
  },
  {
    "path": "finetune/utils/ds_utils.py",
    "chars": 2576,
    "preview": "import deepspeed.comm as dist\nimport torch\n\nGLOBAL_BATCH_SIZE = 32\nMICRO_BATCH_SIZE = 4\n\n\ndef get_train_ds_config(\n    o"
  },
  {
    "path": "finetune/utils/model/model_utils.py",
    "chars": 1770,
    "preview": "import math\n\nfrom transformers import AutoConfig\nfrom transformers.deepspeed import HfDeepSpeedConfig\n\n\ndef create_hf_mo"
  },
  {
    "path": "finetune/utils/module/lora.py",
    "chars": 5280,
    "preview": "import math\n\nimport deepspeed\nimport torch\nimport torch.nn.functional as F\nfrom deepspeed.compression.helper import recu"
  },
  {
    "path": "finetune/utils/perf.py",
    "chars": 2710,
    "preview": "import torch\n\n\n# This function can be used to print throughput for Step 1 and 2 only\ndef print_throughput(hf_model, args"
  },
  {
    "path": "finetune/utils/utils.py",
    "chars": 9248,
    "preview": "import json\nimport os\n\nimport deepspeed\nimport torch\nimport torch.nn as nn\nfrom deepspeed.runtime.zero.partition_paramet"
  },
  {
    "path": "finetune/yi_example_dataset/data/eval.jsonl",
    "chars": 35832,
    "preview": "{\"prompt\": \"Human: 你在学校里看到同学因为某些原因心情不好,你该怎么做来安慰他们? Assistant:\", \"chosen\": \"当遇到同学处于情绪不好的状况时,可以采用以下措施:首先,你要真正地去理解和感受到对方的情绪"
  },
  {
    "path": "finetune/yi_example_dataset/data/train.jsonl",
    "chars": 726498,
    "preview": "{\"prompt\": \"Human: 你正在准备开会,但是发现会议室的白板上还有别人的会议记录,你想给对方一个提醒,让他们及时清理。请给出一个礼貌的提醒。 Assistant:\", \"chosen\": \"“不好意思打扰了,请问这个白板是否还"
  },
  {
    "path": "pyproject.toml",
    "chars": 670,
    "preview": "[tool.poetry]\nname = \"yi-models\"\nversion = \"0.1.1-dev\"\ndescription = \"\"\nauthors = [\"Yi Team <yi@01.ai>\"]\nlicense = \"Apac"
  },
  {
    "path": "quantization/awq/README.md",
    "chars": 789,
    "preview": "# AWQ quantization\n\n\n[AWQ](https://github.com/mit-han-lab/llm-awq) is a PTQ(Post-Training Quantization)\nmethod. It's an "
  },
  {
    "path": "quantization/awq/eval_quantized_model.py",
    "chars": 1365,
    "preview": "from awq import AutoAWQForCausalLM\nfrom transformers import AutoTokenizer\n\n\ndef run_quantization(args):\n    # Load model"
  },
  {
    "path": "quantization/awq/quant_autoawq.py",
    "chars": 1552,
    "preview": "import argparse\nimport logging\n\nfrom awq import AutoAWQForCausalLM\nfrom transformers import AutoTokenizer\n\n\ndef run_quan"
  },
  {
    "path": "quantization/gptq/README.md",
    "chars": 983,
    "preview": "# GPT-Q quantization\n\n[GPT-Q](https://github.com/IST-DASLab/gptq) is a PTQ(Post-Training Quantization)\nmethod. It's memo"
  },
  {
    "path": "quantization/gptq/eval_quantized_model.py",
    "chars": 1237,
    "preview": "from transformers import AutoModelForCausalLM, AutoTokenizer\n\n\ndef run_quantization(args):\n    # Load model\n    tokenize"
  },
  {
    "path": "quantization/gptq/quant_autogptq.py",
    "chars": 2025,
    "preview": "import argparse\nimport logging\n\nfrom transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer, GPTQConfig\n\n\nd"
  },
  {
    "path": "requirements.txt",
    "chars": 109,
    "preview": "transformers>=4.36.2\ngradio>=4.13.0\nprotobuf>=4.25.1\ntorch==2.0.1\naccelerate\nsentencepiece\ndeepspeed\ndatasets"
  }
]

About this extraction

This page contains the full source code of the 01-ai/Yi GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 126 files (3.2 MB), approximately 835.9k tokens, and a symbol index with 204 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!