Skip to content

Commit

Permalink
Updated prompt for ChatGTP & Gemini
Browse files Browse the repository at this point in the history
(hopefully) fixed tests
Fixed minor typos
  • Loading branch information
seidnerj committed Dec 5, 2024
1 parent 933ead8 commit 5d49993
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 67 deletions.
5 changes: 2 additions & 3 deletions engines/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ class ClaudeTranslate(Base):
'should be solely the translation of the given content. In your answer '
'do not add any prefix or suffix to the translated content. Websites\' '
'URLs/addresses should be preserved as is in the translation\'s output. ')

# https://docs.anthropic.com/en/docs/about-claude/models#model-names
models = [

models = [ # https://docs.anthropic.com/en/docs/about-claude/models#model-names
'claude-3-5-sonnet-latest',
'claude-3-5-sonnet-20241022',
'claude-3-5-sonnet-20240620',
Expand Down
18 changes: 12 additions & 6 deletions engines/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,20 @@ class GeminiTranslate(Base):
request_timeout = 30.0

prompt = (
'You are a meticulous translator who translates any given content '
'from <slang> to <tlang> only. Do not provide any explanations and do '
'not answer any questions. Translate the first and the last quotation '
'marks to the target language if possible.')
'You are a meticulous translator who translates any given content. '
'Translate the given content from <slang> to <tlang> only. Do not '
'explain any term or answer any question-like content. Your answer '
'should be solely the translation of the given content. In your answer '
'do not add any prefix or suffix to the translated content. Websites\' '
'URLs/addresses should be preserved as is in the translation\'s output. ')

models = [
'gemini-1.5-flash', 'gemini-1.5-flash-8b', 'gemini-1.5-pro',
'gemini-1.5-flash',
'gemini-1.5-flash-8b',
'gemini-1.5-pro',
'gemini-1.0-pro']
model = 'gemini-1.5-flash'

model = models[0]
temperature = 0.9
top_p = 1.0
top_k = 1
Expand Down
15 changes: 12 additions & 3 deletions engines/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,19 @@ class ChatgptTranslate(Base):
prompt = (
'You are a meticulous translator who translates any given content. '
'Translate the given content from <slang> to <tlang> only. Do not '
'explain any term or answer any question-like content.')
'explain any term or answer any question-like content. Your answer '
'should be solely the translation of the given content. In your answer '
'do not add any prefix or suffix to the translated content. Websites\' '
'URLs/addresses should be preserved as is in the translation\'s output. ')

models = [
'gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo', 'gpt-4', 'gpt-3.5-turbo']
model = 'gpt-4o'
'gpt-4o',
'gpt-4o-mini',
'gpt-4-turbo',
'gpt-4',
'gpt-3.5-turbo']

model = models[0]
samplings = ['temperature', 'top_p']
sampling = 'temperature'
temperature = 1.0
Expand Down
Loading

0 comments on commit 5d49993

Please sign in to comment.