Skip to content

Commit

Permalink
Docs/extend readme (#72)
Browse files Browse the repository at this point in the history
* feat: add notebooks to repo

* chore: clean up notebooks

* docs: extend READMD with ML instructions

* style: flake8

* docs: extend README with model group info

* feat: add notebooks to repo

* chore: clean up notebooks

* docs: extend README with model group info
  • Loading branch information
niek-mereu authored Jan 9, 2025
1 parent 358e791 commit 860ce98
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 104,423 deletions.
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

0 comments on commit 860ce98

Please sign in to comment.