Nota: También he probado creando una clase con un código de python simple y da el mismo error. ¿Puede ser que esta imagen de docker tenga problemas con Python?

Class St.Vectorsearch.Vector Extends %RegisteredObject
{
ClassMethod Embedding(Test) [ Language = python ]
{
   return (Test)
}
}
Compilation started on 04/16/2026 06:12:25 with qualifiers 'cuk'
Compiling class St.Vectorsearch.Vector
ERROR #7802: Worker job/s '1199:40' unexpectedly shut down in group '#Default:(2988722416963):0'.
ERROR #7812: Work queue unexpectedly removed, shutting down.
ERROR #5002: ObjectScript error: <THROW>WaitForComplete+215^%SYS.WorkQueueMgr *%Exception.StatusException ERROR #7802: Worker job/s '1199:40' unexpectedly shut down in group '#Default:(2988722416963):0'.
ERROR #7812: Work queue unexpectedly removed, shutting down.
Detected 3 errors during compilation in 1.014s.

Hola @Luis Angel Pérez Ramos 

He reiniciado mi docker para que vuelva a compilar todo desde cero para ver si así volvía a la vida, pero ahora me aparece el siguiente error cuando compila la clase St.Vectorsearch.Vector

USER>do $system.OBJ.Compile("St.Vectorsearch.Vector","ck")
Compilation started on 04/16/2026 06:05:04 with qualifiers 'ck'
Compiling class St.Vectorsearch.Vector
ERROR #7802: Worker job/s '878:23' unexpectedly shut down in group '#Default:(4743230725894):0'.
ERROR #7812: Work queue unexpectedly removed, shutting down.
ERROR #5002: ObjectScript error: <THROW>WaitForComplete+215^%SYS.WorkQueueMgr *%Exception.StatusException ERROR #7802: Worker job/s '878:23' unexpectedly shut down in group '#Default:(4743230725894):0'.
ERROR #7812: Work queue unexpectedly removed, shutting down.
Detected 3 errors during compilation in 1.003s.

He probado a usar tanto la versión de sentence-transforme que me habías pasado como usando la última versión, y da el mismo error al compilarlo.

¿Alguna idea?

Esta es mi clase St.Vectorsearch.Vector

Class St.Vectorsearch.Vector Extends %RegisteredObject
{
ClassMethod Embedding(Test) [ Language = python ]
{
   from transformers import AutoTokenizer, AutoModel
   import torch
   import torch.nn.functional as F
   #Mean Pooling - Take attention mask into account for correct averaging
   def mean_pooling(model_output, attention_mask):
       token_embeddings = model_output[0] #First element of model_output contains all token embeddings
       input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
       return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)

   # Sentences we want sentence embeddings for
   # sentences = ['This is an example sentence', 'Each sentence is converted']
   sentences = [Test]
   # Load model from HuggingFace Hub
   tokenizer = AutoTokenizer.from_pretrained('sentence-transformers/all-MiniLM-L6-v2')
   model = AutoModel.from_pretrained('sentence-transformers/all-MiniLM-L6-v2')
   # Tokenize sentences
   encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
   # Compute token embeddings
   with torch.no_grad():
       model_output = model(**encoded_input)
   # Perform pooling
   sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
   # Normalize embeddings
   sentence_embeddings = F.normalize(sentence_embeddings, p=2, dim=1)
   #print(sentence_embeddings)
   return str(sentence_embeddings[0].tolist())
}
}

Estoy usando la imagen de docker de community

No, en ningún momento. Simplemente se queda esperando una respuesta del método Embedding y ahí se queda

Este mensaje de error me lo dá cuando reinicio el componente, porque se queda totalmente bloqueado. Esa linea es la que apunta a la llamada al método 

set vector = ##class(St.Vectorsearch.Vector).Embedding(request.StringValue)

Voy a probar.

Es curioso porque si lo ejecuto desde el termina, tarda un poco pero responde. En cambio si es invocado desde un BP, se queda pillado y da un error en el BP.

El código de invocación es el que he puesto en el mensaje.

Este es mi código

ClassMethod Embedding(Text) [ Language = python ]
{
   from transformers import AutoTokenizer, AutoModel
   import torch
   import torch.nn.functional as F
   #Mean Pooling - Take attention mask into account for correct averaging
   def mean_pooling(model_output, attention_mask):
       token_embeddings = model_output[0] #First element of model_output contains all token embeddings
       input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
       return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)

   # Sentences we want sentence embeddings for
   # sentences = ['This is an example sentence', 'Each sentence is converted']
   sentences = [Text]
   # Load model from HuggingFace Hub
   #; tokenizer = AutoTokenizer.from_pretrained('sentence-transformers/all-MiniLM-L6-v2')
   #; model = AutoModel.from_pretrained('sentence-transformers/all-MiniLM-L6-v2')
   
   # Load model from multilingual model
   tokenizer = AutoTokenizer.from_pretrained('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
   model = AutoModel.from_pretrained('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
   # Tokenize sentences
   encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
   # Compute token embeddings
   with torch.no_grad():
       model_output = model(**encoded_input)
   # Perform pooling
   sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
   # Normalize embeddings
   sentence_embeddings = F.normalize(sentence_embeddings, p=2, dim=1)
   #print(sentence_embeddings)
   return str(sentence_embeddings[0].tolist())
}

Additionally, if you have a 401 – Unauthorized status, verify that you have granted the appropriate permissions.

Kurro Lopez · Dec 17, 2025 go to post

Thanks Eduard.

Indeed, adding the class name and the element name makes it work.

Kurro Lopez · Sep 30, 2025 go to post

if you are using Ens.Request as request class, you can redirect you message acording the name of the class using "Switch"

On each switch connector, you must evaluate the class name, as follows:

$classname(request)="MyApp.Msg.Test1"

I hope this is the answer that you are looking for

Best regads

Kurro Lopez · Sep 18, 2025 go to post

Thanks... I was making my own class to convert datetime in other time zone, more or less that is working in C#

You have save me a lot of hours of work.

Well done. 🥇

Kurro Lopez · Sep 9, 2025 go to post

Thanks for the information. I'll have a look the instructions how to implement a Semaphore.

Kurro Lopez · Aug 26, 2025 go to post
  • Went to the sea or a lake
    • YES... I live in a city by the Mediterranean Sea
  • Hiked/enjoyed nature
    • YES... I love it
  • Traveled somewhere new
    • YES... A small town in Galicia
  • Attended a concert or festival
    • YES... Brisa festival
  • Watched a movie or series
    • YES... Every day
  • Read a book
    • YES... A few
  • Earned points and redeemed a reward on Global Masters 🏆
    • YES.. Every day
  • Joined READY 2025 🎉
    • NO :( 
  • Spent time with family or friends
    • YES.. Always
Kurro Lopez · Jun 30, 2025 go to post

Great team!!!
I've missed you all so much this year, I hope to see you all next year.

Kurro Lopez · Jun 25, 2025 go to post

Thanks, Evgeny, as always.

It's not a bad idea to use an abbreviation map and Python for this. I can create a table with the code name and replace it with the UTC value.

https://www.timeanddate.com/time/zones/

This is a complete list of time zone codes and their UTC values.

What's the problem? Some are duplicated.

According to this list, Thursday, July 3rd at 08:20:00 AST, 2025 could be:

AST: Arabia Standard Time - UTC+03

AST: Atlantic Standard Time - UTC-04

Perhaps there's a mistake in the list.

Kurro Lopez · May 28, 2025 go to post

Hi community:

  • My name is Francisco López, AKA Kurro López
  • I'm from Spain, born and living in Málaga (Andalusia) in southern Spain, close to Mediterranean Sea.
  • Working as project manager in Salutic Soluciones, SL. This company is dedicated to creating software for medical management and services for health insurance companies.
  • I have extensive programming experience in several languages, from Clipper 87 to C#, including Python, PowerBuilder, Visual Basic, and, of course, ObjectScript. I've spent a long career dedicated to programming and the technical and functional analysis of new processes. I love programming in IRIS because it gives me a lot of freedom when generating complex workflows that would be much slower to complete with other languages.
  • My main hobby is the mountains. I love long walks, hiking, and discovering new places. I used to do mountain running, but my knees aren't what they used to be.
  • LinkedIn: https://www.linkedin.com/in/franciscolopezdelasheras/
  • I won't be attending READY 2025 this year, but I have attended in previous years and it's a great experience that everyone should go to at least once.
Kurro Lopez · Apr 7, 2025 go to post

Also... you can create a ClassMethod to pass the fields to retrieve

ClassMethod DynamicQuery(columns As %String) As %Status
{
    // columns: comma-separated string, e.g. "Book,Author"
    
    // Basic validation
    If columns = "" {
        Write "No columns specified.", !
        Quit $$$ERROR
    }
    
    // Build the SQL query
    Set sql = "SELECT " _ columns _ " FROM myTables.Books"
    
    Try {
        Set stmt = ##class(%SQL.Statement).%New()
        Set sc = stmt.%Prepare(sql)
        If $$$ISERR(sc) {
            Write "Error preparing the query.", !
            Quit sc
        }
        
        Set rset = stmt.%Execute()
        
        While rset.%Next() {
            For i = 1:1:rset.%ColumnCount {
                Write rset.%GetColumnName(i), ": ", rset.%Get(i), " | "
            }
            Write !
        }
    } Catch ex {
        Write "Error executing the query: ", ex.DisplayString(), !
        Quit ex.AsStatus()
    }

    Quit $$$OK
}

Then, call it using this command:

Do ##class(MyApp.Utils).DynamicQuery("Book,Author")
Kurro Lopez · Apr 7, 2025 go to post

Hi @Touggourt 

If you want to retrieve the values, prepare the query by concatenating the values ​​you want to retrieve

set var1 = "Book"
set var2 = "Author"
set query = "SELECT "_var1_","_var2_" FROM myTables.Books"
set statement = ##class(%SQL.Statement).%New()

set status = statement.%Prepare(query)
set rset = statement.%Execute()
do rset.%Display()

Have a look the following link:

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cl…

Regards
 

Kurro Lopez · Apr 1, 2025 go to post

Thanks @Brett Saviano 

I've already taken a look at the api/atelier APIs, and they've been very helpful in retrieving namespace names.

In our check method, in addition to server information, we return more information about production, such as the version number, last installation date, connection status with external databases, etc.

We have two mirrored servers, so if one of the servers goes down, the backup server is activated.

If the server name is different than expected, it's because the backup server has been activated and is providing service without issue, but we have an alert that the primary server has gone down.

This is an example of what our check service returns:

{
  "result": "OK",
  "methods": [
    {
      "test": "SQL_USERS",
      "result": "OK"
    },
    {
      "test": "SQL_APPOINTMENT",
      "result": "OK"
    },
    {
      "test": "VERSION",
      "result": "1.14.0.0327"
    },
    {
      "test": "INSTALLED",
      "result": "2024-12-04T08:04:52+01:00"
    }
  ],
  "serverName": "SRVPROD01",
  "serverApi": "10.168.1.1",
  "serverInstance": "HEALTHCONNECT",
  "execution_time": "00:00:00.0597418"
}