Skip to content

Commit

Permalink
fix response body
Browse files Browse the repository at this point in the history
  • Loading branch information
DGaffney committed Nov 3, 2023
1 parent 8a32cdf commit e7fec72
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/model/fasttext.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ def respond(self, docs: Union[List[schemas.Message], schemas.Message]) -> List[s
detected_langs.append({'language': model_language, 'script': model_script, 'score': model_certainty})

for doc, detected_lang in zip(docs, detected_langs):
doc.response = detected_lang
doc.body.hash_value = detected_lang
return docs
2 changes: 1 addition & 1 deletion lib/model/generic_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def respond(self, docs: Union[List[schemas.Message], schemas.Message]) -> List[s
vectorizable_texts = [e.body.text for e in docs]
vectorized = self.vectorize(vectorizable_texts)
for doc, vector in zip(docs, vectorized):
doc.hash_value = vector
doc.body.hash_value = vector
return docs

def vectorize(self, texts: List[str]) -> List[List[float]]:
Expand Down

0 comments on commit e7fec72

Please sign in to comment.