Working offline without internet connection with SentenceTransformer - Bertopic

Viewed 25

I am trying to work with Bertoic and use SentenceTransformer locally without needing to use an internet connection every time to download the packages. I followed this link to use the downloaded files, but it connected to the internet and downloaded the files every time.

Below is my code

import pandas as pd 
import numpy as np
from bertopic import BERTopic
from sentence_transformers import SentenceTransformer

embedding_model = SentenceTransformer('D:/all-mpnet-base-v2') #Here is the path to my downloaded SentenceTransformer
df = pd.read_csv('RecoveryData.csv', parse_dates=[1], infer_datetime_format=True)

model = BERTopic(verbose=True, embedding_model= embedding_model)
#convert to list 
docs = df.text.to_list()

topics, probabilities = model.fit_transform(docs)

Can anyone tell me what I am missing here ?

0 Answers
Related