Error downloading pretrained model within Python Tool on server for SentenceTransformers
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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:
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.
Solved! Go to Solution.
- Labels:
- API
- Error Message
- Gallery
- Server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Fixed this by changing the package install command to upgrade
Package.installPackages(package='numpy',install_type='install --upgrade')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This fixed the issue I was having also.
