Skip to content

Commit

Permalink
Merge pull request #906 from weni-ai/hotfix/zeroshot-lang-codes
Browse files Browse the repository at this point in the history
Update language codes
  • Loading branch information
johncordeiro authored Feb 5, 2024
2 parents d531ca9 + b5627a7 commit 73ce367
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions bothub/api/v2/zeroshot/usecases/format_prompt.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

class FormatPrompt:
const_prompt_data = {
"pt-br": {
"por": {
"prompt_context": "Você é muito especialista em ",
"prompt_has_classes": ". Você possui as classes:\\n\\n",
"prompt_class_prefix": "Classe: ",
Expand All @@ -12,7 +12,7 @@ class FormatPrompt:
"prompt_phrase_prefix": "Frase: ",
"prompt_analyse_text": "Pare, pense bem e analise qual é a melhor resposta de classe para a frase, responda só se você tiver muita certeza.\\n\\nClasse:"
},
"en": {
"eng": {
"prompt_context": "You are very expert in ",
"prompt_has_classes": ". You have the following classes:\\n\\n",
"prompt_class_prefix": "Class: ",
Expand All @@ -23,7 +23,7 @@ class FormatPrompt:
"prompt_phrase_prefix": "Sentence: ",
"prompt_analyse_text": "Stop, think carefully and analyze what the best class answer to the sentence is, only answer if you are very sure.\\n\\nClass:"
},
"es": {
"spa": {
"prompt_context": "Eres muy experto en ",
"prompt_has_classes": ". Usted posee las clases:\\n\\n",
"prompt_class_prefix": "Clase: ",
Expand Down
4 changes: 1 addition & 3 deletions bothub/api/v2/zeroshot/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ def post(self, request):

prompt_formatter = FormatPrompt()

data["language"] = prompt_formatter.get_language(data.get("language", "pt-br"))

prompt = prompt_formatter.generate_prompt(data.get("language"), data)
prompt = prompt_formatter.generate_prompt(data.get("language", "por"), data)

body = {
"input": {
Expand Down

0 comments on commit 73ce367

Please sign in to comment.