Hello, I am still relatively new to using n8n. I am trying to convert a python script workflow onto n8n. Part of the workflow consists of using a sentence transformer to do semantic filtering. I had issues with my HuggingFace credentials and realised that it is an on-going issue for others as well. I would like to reach out to ask for viable alternatives to running a sentence transformer within n8n, if possible. Thanks in advance!
You can use openai chat competition API. deploy the sentence transformer embedding endpoint through Azure Functions and then utilize that endpoint inside the embedding_dependency parameter.
completion = client.chat.completions.create(
model=deployment,
messages=[
{
“role”: “system”,
“content”: “You are an AI assistant that helps people find information.”
}
],
past_messages=10,
max_tokens=800,
temperature=0.7,
top_p=0.95,
frequency_penalty=0,
presence_penalty=0,
stop=None,
extra_body={
“data_sources”: [
{
“type”: “azure_search”,
“parameters”: {
“endpoint”: os.environ[“AZURE_AI_SEARCH_ENDPOINT”],
“index_name”: os.environ[“AZURE_AI_SEARCH_INDEX”],
“authentication”: {
“type”: “api_key”,
“key”: “value”
},
“embedding_dependency”: {
“type”: “endpoint”,
“endpoint”: app_settings.azure_openai.embedding_endpoint,
“authentication”: {
“type”: “api_key”,
“key”: app_settings.azure_openai.embedding_key
}
}
}
}
]
}
)
i see, this means that i will need an Azure subscription and deploy an instance of the sentence transformer in Azure Cloud instead?
Hello! For future users who encounter this issue, this issue was for my n8n version of 1.104.1 (for me specifically) and is resolved when I updated to version 1.107.3
So if anyone is seeing this due to a huggingface credentials issue as well, do check the change log to make sure that your current flows will not be affected and updated your n8n to 1.107.3 (at least in my case).
TL:DR: Update your n8n to a later version but make sure to read the change log so that your current flows won’t break.
Cheers!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.