Skip to content

Commit f08e670

Browse files
author
tseimandi
committed
Keep order of output for label output
1 parent cbeb0f2 commit f08e670

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async def predict_label(q: List[str] = Query(..., title="query string", descript
6363

6464
for nomenclature in n:
6565
output[nomenclature] = {}
66-
descriptions = list(set(q))
66+
descriptions = sorted(set(q), key=q.index)
6767
preprocessed_descriptions = [preprocess_text(description) for description in descriptions]
6868
preds = predict_using_model(preprocessed_descriptions, model=models[nomenclature], k=k)
6969
if v:

0 commit comments

Comments
 (0)