Spaces:
Sleeping
Sleeping
jonathanjordan21
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -523,13 +523,15 @@ def respond(
|
|
523 |
# documents = [v["name"] for v in detail_perhitungan.values()]
|
524 |
sentence_pairs = [[message, v["name"]] for v in detail_perhitungan.values()]
|
525 |
scores = model.predict(sentence_pairs, convert_to_tensor=True)
|
|
|
526 |
# scores = [x["score"] for x in model.rank(message, documents)]
|
527 |
else:
|
528 |
text_emb = model.encode(message)
|
529 |
scores = cos_sim(codes_emb, text_emb).mean(axis=-1)#[:,0]
|
|
|
530 |
|
531 |
scores_argsort = scores.argsort(descending=True)
|
532 |
-
|
533 |
|
534 |
# if n_num == 0:
|
535 |
# std = scores.std()
|
|
|
523 |
# documents = [v["name"] for v in detail_perhitungan.values()]
|
524 |
sentence_pairs = [[message, v["name"]] for v in detail_perhitungan.values()]
|
525 |
scores = model.predict(sentence_pairs, convert_to_tensor=True)
|
526 |
+
weights = [1,1,1,1,1,1,1,1,1]
|
527 |
# scores = [x["score"] for x in model.rank(message, documents)]
|
528 |
else:
|
529 |
text_emb = model.encode(message)
|
530 |
scores = cos_sim(codes_emb, text_emb).mean(axis=-1)#[:,0]
|
531 |
+
weights = [19,8,7,6,5,4,3,2,1]
|
532 |
|
533 |
scores_argsort = scores.argsort(descending=True)
|
534 |
+
|
535 |
|
536 |
# if n_num == 0:
|
537 |
# std = scores.std()
|