perf: use lighter topic model
This commit is contained in:
@@ -12,7 +12,7 @@ app = Flask(__name__)
|
||||
CORS(app, resources={r"/*": {"origins": "http://localhost:5173"}})
|
||||
|
||||
# Global State
|
||||
posts_df = pd.read_json('posts_test.jsonl', lines=True)
|
||||
posts_df = pd.read_json('posts.jsonl', lines=True)
|
||||
with open("topic_buckets.json", "r", encoding="utf-8") as f:
|
||||
domain_topics = json.load(f)
|
||||
stat_obj = StatGen(posts_df, domain_topics)
|
||||
|
||||
@@ -63,7 +63,7 @@ class NLP:
|
||||
def _get_topic_model(cls, device_str: str) -> SentenceTransformer:
|
||||
model = cls._topic_models.get(device_str)
|
||||
if model is None:
|
||||
model = SentenceTransformer("all-mpnet-base-v2", device=device_str)
|
||||
model = SentenceTransformer("all-MiniLM-L6-v2", device=device_str)
|
||||
cls._topic_models[device_str] = model
|
||||
return model
|
||||
|
||||
|
||||
Reference in New Issue
Block a user