Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load the HnswSimilarity model #55

Closed
humeilPixisDatascience opened this issue Dec 10, 2022 · 1 comment
Closed

Unable to load the HnswSimilarity model #55

humeilPixisDatascience opened this issue Dec 10, 2022 · 1 comment

Comments

@humeilPixisDatascience
Copy link

Hi can you please help me loading the model . I am using pyspark --packages 'com.github.jelmerk:hnswlib-spark_3.3_2.12:1.0.1' command

creating instance

hnsw = HnswSimilarity(identifierCol='id', queryIdentifierCol='id' , featuresCol='company_industry_embeddings', distanceFunction='cosine', m=48, ef=5, k=200, efConstruction=200, numPartitions=50, excludeSelf=True)
test = hnsw.fit(df)
test.save(path)

reading the model

model = hnsw.load(path) ## gives error

Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/spark/python/pyspark/ml/util.py", line 353, in load
return cls.read().load(path)
File "/usr/lib/spark/python/pyspark/ml/util.py", line 365, in read
return JavaMLReader(cls)
File "/usr/lib/spark/python/pyspark/ml/util.py", line 296, in init
self._jread = self._load_java_obj(clazz).read()
TypeError: 'JavaPackage' object is not callable

@humeilPixisDatascience
Copy link
Author

The issue is resolved now

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant