-
Notifications
You must be signed in to change notification settings - Fork 0
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 Index #1
Create Index #1
Conversation
index.js
Outdated
const request = { | ||
parent, | ||
index: { | ||
displayName: "my-demo-index", | ||
indexUpdateMethod: "STREAM_UPDATE", | ||
description: "My fist index", | ||
metadataSchemaUri: | ||
"gs://google-cloud-aiplatform/schema/matchingengine/metadata/nearest_neighbor_search_1.0.0.yaml", | ||
metadata: { | ||
config: { | ||
dimensions: 1536, | ||
shardSize: "SHARD_SIZE_SMALL", | ||
}, | ||
}, | ||
}, | ||
}; | ||
console.log("[createIndex] request", request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dimensions is required but missing from Index metadata. って言われる。なんで。
metadataの与え方はあっているはず
https://cloud.google.com/vertex-ai/docs/matching-engine/configuring-indexes?hl=ja
--metadata-file="metadata/my-demo-index.json" \ | ||
--display-name="my-demo-index" \ | ||
--project=$PROJECT \ | ||
--region=us-central1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
なるほど?
Using endpoint [https://us-central1-aiplatform.googleapis.com/]
ERROR: (gcloud.ai.indexes.create) FAILED_PRECONDITION: The Cloud Storage bucket of `gs://my-demo-embbeddings/` is in location `us`. It must be in the same regional location as the service location `us-central1`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
アイオワのバケットを指定して再度実行
Using endpoint [https://us-central1-aiplatform.googleapis.com/]
ERROR: (gcloud.ai.indexes.create) FAILED_PRECONDITION: The given gcs path `gs://my-demo-embbeddings2/` is not a valid directory or the directory is empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
初期データをなにか入れないと作れないのか!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
そしてこの方法だと STREAM_UPDATE
モードにならないことに気付いてしまった
https://zenn.dev/google_cloud_jp/articles/getting-started-matching-engine#index-%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B
}, | ||
"shardSize": "SHARD_SIZE_SMALL" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1 @@ | |||
{"id": "Cat1","embedding": [1, 0.2, 0.1],"restricts": [{ "namespace": "class", "allow": ["cat", "pet"] },{ "namespace": "category", "allow": ["feline"] }]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このように1行1レコードの形式にすること!
https://scrapbox.io/daiiz/Vertex_AI_Matching_Engineを使ってみる
中身は確認できていないが
my-demo-index-22
の作成が完了した。メモ
my-demo-index-22
の作成が完了したらmy-demo-index
は削除してよし-22
の方はBool filterの練習用の仕込みをしてある