Skip to content

Commit

Permalink
chore: Updated models of ChatGPT.
Browse files Browse the repository at this point in the history
  • Loading branch information
bookfere committed Nov 8, 2023
1 parent d84e50c commit 4650c6f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ As an open source project, Ebook Translator relies on the goodwill of individual

|Date| Name|Amount|
|---|---|---|
|2023-10-15|*|¥66|
|2023-10-08|N**YC|$17.85|
|2023-10-08|*|¥23.33|
|2023-09-24|We**** Wei|$10|
Expand Down
1 change: 1 addition & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ __插件主页__:[https://translator.bookfere.com](https://translator.bookfere

|日期|捐赠者|数额|
|---|---|---|
|2023-10-15|*|¥66|
|2023-10-08|N**YC|$17.85|
|2023-10-08|*|¥23.33|
|2023-09-24|We**** Wei|$10|
Expand Down
6 changes: 3 additions & 3 deletions engines/chatgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class ChatgptTranslate(Base):
'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.')
models = ['gpt-3.5-turbo', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-16k',
'gpt-4', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0613',
'gpt-3.5-turbo-16k-0613']
models = ['gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-instruct',
'gpt-3.5-turbo-1106', 'gpt-4', 'gpt-4-0613', 'gpt-4-32k',
'gpt-4-32k-0613', 'gpt-4-1106-preview', 'gpt-4-vision-preview']
model = 'gpt-3.5-turbo'
samplings = ['temperature', 'top_p']
sampling = 'temperature'
Expand Down
2 changes: 1 addition & 1 deletion lib/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ def get_content(self, placeholder):

def add_translation(self, translation, placeholder, position=None,
lang=None, color=None):
# Escape the markups (<m id=1 />) to replace escaped markups.
translation = xml_escape(translation)
count = 0
for reserve in self.reserve_elements:
# Escape the markups (<m id=1 />) to replace escaped markups.
pattern = placeholder[1].format(r'\s*'.join(format(count, '05')))
# Prevent potential invalid escapes from affecting the replacement.
translation = re.sub(
Expand Down

0 comments on commit 4650c6f

Please sign in to comment.