t_wの輪郭

python3 -m transformers.onnx --model=sentence-transformers/paraphrase-multilingual-mpnet-base-v2 onnx/ --opset=18

optimum-cli onnxruntime quantize --onnx_model ./onnx --output onnx_quantize/ --arm64

あれ

2023/11/28 1:27:00

Amplifyでプロジェクトディレクトリが分割されてしまうので、Sentence Embeddingのモデルの位置が開発環境とサーバーで異なってしまう。だもんだから、ローカルからnode_modulesとしてインストールして、分割されても位置が変わらないようにするみたいなことをしようとしたものの、ローカルからインストールしたパッケージはAmplifyにデプロイすると削除されてしまうようだ。

version: 1
backend:
  phases:
    preBuild:
      commands:
    build:
      commands:
        - '# Execute Amplify CLI with the helper script'
        - amplifyPush --simple
frontend:
  phases:
    preBuild:
      commands:
        - sudo yum install git-lfs -y
        - git lfs install
        - git pull
        - npm ci
        - npm install ./embedding
    build:
      commands:
        - npm run build
  artifacts:
    baseDirectory: .next
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

Amazon Linux 2023で以下のymlを設定する

version: 1
backend:
  phases:
    preBuild:
      commands:
    build:
      commands:
        - '# Execute Amplify CLI with the helper script'
        - amplifyPush --simple
frontend:
  phases:
    preBuild:
      commands:
        - npm ci
        - sudo yum install git-lfs -y
        - git lfs install
        - git pull
    build:
      commands:
        - npm run build
  artifacts:
    baseDirectory: .next
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*