Hi @GlebCA Welcome to the community
I think everything you are looking for is here
I have not loaded from a filesystem but I just ran these and it worked
Downloaded and start.
There is also python libraries for this beside just pure curl
sbrown$ curl -X PUT "localhost:9200/_ml/trained_models/.elser_model_2?pretty" -H 'Content-Type: application/json' -d'{ "input": { "field_names": ["text_field"] }}'
{
"model_id" : ".elser_model_2",
"model_type" : "pytorch",
"model_package" : {
"packaged_model_id" : "elser_model_2",
"model_repository" : "https://ml-models.elastic.co",
"minimum_version" : "11.0.0",
"size" : 438123914,
"sha256" : "2e0450a1c598221a919917cbb05d8672aed6c613c028008fedcd696462c81af0",
"metadata" : { },
"tags" : [ ],
"vocabulary_file" : "elser_model_2.vocab.json"
},
"created_by" : "api_user",
"version" : "12.0.0",
"create_time" : 1710191067705,
"model_size_bytes" : 0,
"estimated_operations" : 0,
"license_level" : "platinum",
"description" : "Elastic Learned Sparse EncodeR v2",
"tags" : [
"elastic"
],
"metadata" : { },
"input" : {
"field_names" : [
"text_field"
]
},
"inference_config" : {
"text_expansion" : {
"vocabulary" : {
"index" : ".ml-inference-native-000002"
},
"tokenization" : {
"bert" : {
"do_lower_case" : true,
"with_special_tokens" : true,
"max_sequence_length" : 512,
"truncate" : "first",
"span" : -1
}
}
}
},
"location" : {
"index" : {
"name" : ".ml-inference-native-000002"
}
}
}
hyperion:docker sbrown$
hyperion:docker sbrown$ curl -X POST "localhost:9200/_ml/trained_models/.elser_model_2/deployment/_start?deployment_id=for_search&pretty"
{
"assignment" : {
"task_parameters" : {
"model_id" : ".elser_model_2",
"deployment_id" : "for_search",
"model_bytes" : 438123914,
"threads_per_allocation" : 1,
"number_of_allocations" : 1,
"queue_capacity" : 1024,
"cache_size" : "438123914b",
"priority" : "normal",
"per_deployment_memory_bytes" : 0,
"per_allocation_memory_bytes" : 0
},
"routing_table" : {
"xrWfSmBySNaLakwl5N46XQ" : {
"current_allocations" : 1,
"target_allocations" : 1,
"routing_state" : "started",
"reason" : ""
}
},
"assignment_state" : "started",
"start_time" : "2024-03-11T21:05:36.439254475Z",
"max_assigned_allocations" : 1
}
}
hyperion:docker sbrown$