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

Docs/extend readme #72

Merged
merged 9 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ os_man.reindex(
```

**Text Embeddings**

For using text embeddings, ML must be enabled in the index settings. The following example shows how to enable ML in the index settings.

```
Expand All @@ -170,13 +171,25 @@ cluster_settings = {
os_man.update_cluster_settings(cluster_settings)
```

Create a model group:

```
POST /_plugins/_ml/model_groups/_register
{
"name": "model-group",
"description": "A model group",

}
```

To create a model, the following example shows how to create a model with the given parameters.

```
model_payload = {
"name": "example-model",
"version": "1.0.0",
"model_format": "TORCH_SCRIPT"
"model_group_id": "model-group",
}
os_man.send_post_request(
"/_plugins/_ml/models/_register",
Expand Down Expand Up @@ -244,7 +257,7 @@ source = {
params = {
"query_text": "This is a sample query",
"model_id": "model_id",
"k": "number_of_results"
"k": "number_of_nearest_neighbors"
}

os_man.upload_search_template(
Expand All @@ -255,8 +268,6 @@ os_man.upload_search_template(
)
```



## <a name="contribution">:construction_worker_man: Contribution</a>

### <a name="local-env-setup">:wrench: Local environment setup</a>
Expand Down
Loading
Loading