Skip to content

Commit

Permalink
Changed prompt in get_language
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-pawelek committed Aug 27, 2024
1 parent bce471c commit 1b055ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion llm_translate/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _set_llm(self, chatgpt_model_name):
async def async_get_text_language(self, text) -> TextLanguage:
text = get_first_n_words(text, self.max_length)
messages = [
{"role": "system", "content": f"You are a language detector. You should return only the ISO 639-1 code of the text provided by user. All ISO-639-1 codes you can find here:\n {iso_639_1_codes}"},
{"role": "system", "content": f"You are a language detector. You should return only the ISO 639-1 code of the text provided by user."},
{"role": "user", "content": text}
]

Expand Down
3 changes: 1 addition & 2 deletions tests/test_get_text_language_multiple_languages.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'''

import os

import pytest
Expand Down Expand Up @@ -457,4 +457,3 @@ def test_get_text_language_small_model(translator_small_model, text, expected_la
else:
assert detected_language == expected_language_code

'''

0 comments on commit 1b055ea

Please sign in to comment.