Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

Error downloading pretrained model within Python Tool on server for SentenceTransformers

CCarroll-
7 - Meteor

I have created a workflow which compares the similarity of two sentences. I have done this by utilising the Python package SentenceTransformers to encode the sentence, then comparing the two encoded sentences using sklearn Cosine similarity formula to put a numeric figure on how similar the sentences are to each other. 

 

The Python script downloads a pretrained model which is hosted on the Hugging Face model hub. The code to download the pretrained model is as follows: 

 

from sentence_transformers import SentenceTransformer
model = SentenceTransformer('bert-base-nli-mean-tokens')

 

The script runs fine with no errors when I run it locally on designer. When I inspect the Jupiter notebook after I can see that it did in fact download the model. I get the correct output that I want. However, when I save the workflow to my private Alteryx server and run it I get the following error message:

 

office.jpg

 

I have underlined in red where it mentions that the numpy version is below what is required. I have tried to fix this by using the Alteryx.installPackage function but with no avail. 

 

Does anyone have any experience importing pretrained models using the Python tool within a workflow on Alteryx server? Can anyone tell me why exactly this is running fine locally but running into errors on the server? Any assistance at all with this is greatly appreciated.

2 REPLIES 2
CCarroll-
7 - Meteor

Fixed this by changing the package install command to upgrade

 

Package.installPackages(package='numpy',install_type='install --upgrade')

samdarmo
7 - Meteor

This fixed the issue I was having also.