Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create STREAM_UPDATE Index #5

Merged
merged 8 commits into from
Jun 7, 2023
Merged

Create STREAM_UPDATE Index #5

merged 8 commits into from
Jun 7, 2023

Conversation

daiiz
Copy link
Owner

@daiiz daiiz commented Jun 7, 2023

インデックス作成

$ sh create-stream-index.sh

完了!

---
createTime: '2023-06-07T08:25:30.020154Z'
displayName: Search index for my text embeddings
etag: AMEw9yOrLAoJ7yfEObYYe5b6rMqJEqtP8yH_zcDsFxxXg_LveK9xfTS5Helvqm7YOumL
indexStats:
  shardsCount: 1
  vectorsCount: '10'
indexUpdateMethod: STREAM_UPDATE
metadata:
  config:
    algorithmConfig:
      treeAhConfig: {}
    approximateNeighborsCount: 100
    dimensions: 1536
    shardSize: SHARD_SIZE_SMALL
metadataSchemaUri: gs://google-cloud-aiplatform/schema/matchingengine/metadata/nearest_neighbor_search_1.0.0.yaml
name: projects/349...locations/us-central1/indexes/541...
updateTime: '2023-06-07T09:10:37.723917Z'

@daiiz
Copy link
Owner Author

daiiz commented Jun 7, 2023

入力テキストのEmbeddingを得るスクリプト

$ node tools/gen-embedding.js こんにちは > "./sampledata/text/$(uuidgen).json"

"metadata": {
"contentsDeltaUri": "gs://my-demo-embbeddings2/index_dir3/",
"config": {
"dimensions": 1536,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://openai.com/blog/new-and-improved-embedding-model

Smaller embedding size. The new embeddings have only 1536 dimensions, one-eighth the size of davinci-001 embeddings, making the new embeddings more cost effective in working with vector databases.

@daiiz
Copy link
Owner Author

daiiz commented Jun 7, 2023

メモ

初期データを与えるGCSバケットではサブディレクトリを作ってはいけない。

{
  "error": {
    "code": 400,
    "message": "The given root directory `gs://my-demo-embbeddings2/index_dir3/` contains unexpected subdirectory (e.g. `text/03E64EE5-9BD1-4185-99F2-32334821E844.json`). No subdirectory is allowed except \"delete/\".",
    "status": "FAILED_PRECONDITION"
  }
}

@daiiz
Copy link
Owner Author

daiiz commented Jun 7, 2023

次: IndexEndpointにデプロイしたIndexを差し替えるには?

@daiiz
Copy link
Owner Author

daiiz commented Jun 7, 2023

メモ

着々と課金が始まっている

@daiiz daiiz merged commit 7c47c8f into main Jun 7, 2023
@daiiz daiiz deleted the create-stream-updating-index branch June 7, 2023 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant