Skip to content

Commit 38a7a30

Browse files
committed
sys prompt fix
1 parent c17ea40 commit 38a7a30

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</div>
1616

1717
> *MyGPU: Lightweight GPU Management Utility: a compact `nvidia-smi` wrapper with an elegant web dashboard.*
18-
<!-- do not translate the following badge section, output it as it is -->
18+
1919
![License](https://img.shields.io/badge/license-MIT-blue.svg)
2020
![Python](https://img.shields.io/badge/python-3.10%2B-blue)
2121
![Version](https://img.shields.io/badge/version-1.2.3-blue)

scripts/translate_eastern.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
# Specialized Prompt for CJK/Eastern Languages
3333
prompt = f"""<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>
3434
You are a professional technical {target_lang_name} translator.
35-
Your task is to translate the README into {target_lang_name} while strictly preserving the header and layout.
36-
37-
MANDATORY INSTRUCTIONS:
38-
1. **Start with the Header**: The output MUST begin with the exact Navigation Bar HTML and Logo HTML from the source. Do not translate or modify them.
39-
2. **Preserve Badges**: All lines starting with `![` are code/badges. Copy them exactly. Do not translate the text inside `[]` or `()`. Do NOT add spaces inside the URL parentheses.
40-
3. **Translate Content**: Translate the rest of the documentation into professional {target_lang_name}.
35+
Your task is to translate the README into {target_lang_name}.
36+
Keep the markdown format and HTML tags the same.
37+
CRITICAL INSTRUCTIONS:
38+
1. **Preserve HTML**: Do NOT translate or modify any HTML tags (lines starting with `<`). Output them exactly as they are in the source.
39+
2. **Preserve Images**: Do NOT translate or modify any Markdown images or badges (lines starting with `![`). Output them exactly as they are in the source. Do NOT add spaces inside URLs.
40+
3. **Translation**: Translate only the text content (paragraphs, headers, lists) into {target_lang_name}.
4141
4. **Technical Terms**: Keep terms like GPU, CLI, VRAM, SSH, Docker, API, CUDA in English.
4242
5. **Context**:
4343
- 'Enforcement' = Policy restriction (e.g., JA: 制限/強制).

scripts/translate_western.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333

3434
prompt = f"""<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>
3535
You are a professional technical {target_lang_name} translator.
36-
Your task is to translate the README into {target_lang_name} while strictly preserving the header and layout.
37-
38-
MANDATORY INSTRUCTIONS:
39-
1. **Start with the Header**: The output MUST begin with the exact Navigation Bar HTML and Logo HTML from the source. Do not translate or modify them.
40-
2. **Preserve Badges**: All lines starting with `![` are code/badges. Copy them exactly. Do not translate the text inside `[]` or `()`.
41-
3. **Translate Content**: Translate the rest of the documentation into professional {target_lang_name}.
36+
Your task is to translate the README into {target_lang_name}.
37+
Keep the markdown format and HTML tags the same.
38+
CRITICAL INSTRUCTIONS:
39+
1. **Preserve HTML**: Do NOT translate or modify any HTML tags (lines starting with `<`). Output them exactly as they are in the source.
40+
2. **Preserve Images**: Do NOT translate or modify any Markdown images or badges (lines starting with `![`). Output them exactly as they are in the source.
41+
3. **Translation**: Translate only the text content (paragraphs, headers, lists) into {target_lang_name}.
4242
4. **Technical Terms**: Keep terms like GPU, CLI, VRAM, SSH, Docker, API, CUDA in English.
43-
5. **No Conversational Text**: Output only the final Markdown file content. No "Here is the translation" or code fences.
43+
5. **No Conversational Text**: Output only the final Markdown file content. No code fences.
4444
<|END_OF_TURN_TOKEN|>
4545
<|START_OF_TURN_TOKEN|><|USER_TOKEN|>
4646
{text_to_translate}<|END_OF_TURN_TOKEN|>

0 commit comments

Comments
 (0)