Skip to content

Commit

Permalink
Modify GPTMDT prompt to preserve source code and re-translate two aff…
Browse files Browse the repository at this point in the history
…ected files
  • Loading branch information
Occhioverde committed Feb 1, 2024
1 parent 83667b8 commit 220394f
Show file tree
Hide file tree
Showing 4 changed files with 528 additions and 429 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ book/
.DS_Store
target
tmp
result
gptmdt_settings.toml
result
38 changes: 38 additions & 0 deletions gptmdt_settings.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# We use the GPT-4 model in order to be able to reliably use the ignorelist below
gptmodel = "gpt-4"

# The default prompt with an additional clause to avoid getting the source code (or examples' output) translated
sysprompt = "You shall translate the following markdown to Italian, preserving the existing formatting and avoiding any other output. Please refrain from translating anything inside a Markdown source code box."

# List of domain-specific terms that GPT shouldn't translate
ignorelist = [
"Ownership",
"Borrowing",
"Lifetime",
"Trait",
"Struct",
"Enum",
"Match",
"Option",
"Result",
"Crate",
"Module",
"Cargo",
"Slice",
"Iterator",
"Closure",
"Mutable",
"Immutable",
"Reference",
"Borrow Checker",
"Concurrency",
"Mutex",
"Atomic",
"Async",
"Smart Pointer"
]

# PLEASE NOTE: The OpenAI API key isn't saved here for obvious reasons and you should
# never commit this file in case you edit it into.
# To pass the API key to the program please run it with the following
# syntax: "GPTMDT_OPENAITOKEN=... gpt_md_translator ..."
Loading

0 comments on commit 220394f

Please sign in to comment.