Spaces:
Sleeping
Sleeping
Update backend/lens_core.py
Browse files- backend/lens_core.py +9 -7
backend/lens_core.py
CHANGED
|
@@ -39,10 +39,10 @@ DO_AI_OVERLAY = False
|
|
| 39 |
AI_CACHE = False
|
| 40 |
AI_CACHE_PATH = "ai_cache.json"
|
| 41 |
AI_PATH_OVERLAY = "overlay_ai.png"
|
| 42 |
-
AI_PROVIDER = "
|
| 43 |
-
AI_MODEL = "
|
| 44 |
AI_BASE_URL = "auto"
|
| 45 |
-
AI_TEMPERATURE = 0.
|
| 46 |
|
| 47 |
AI_MAX_TOKENS = 1200
|
| 48 |
AI_TIMEOUT_SEC = 120
|
|
@@ -403,10 +403,12 @@ AI_MODEL_ALIASES = {
|
|
| 403 |
|
| 404 |
AI_PROMPT_SYSTEM_BASE = (
|
| 405 |
"You are a professional manga translator and dialogue localizer.\n"
|
| 406 |
-
"
|
| 407 |
-
"
|
| 408 |
-
"
|
| 409 |
-
"
|
|
|
|
|
|
|
| 410 |
)
|
| 411 |
|
| 412 |
AI_LANG_STYLE = {
|
|
|
|
| 39 |
AI_CACHE = False
|
| 40 |
AI_CACHE_PATH = "ai_cache.json"
|
| 41 |
AI_PATH_OVERLAY = "overlay_ai.png"
|
| 42 |
+
AI_PROVIDER = "huggingface"
|
| 43 |
+
AI_MODEL = "google/gemma-3-27b-it"
|
| 44 |
AI_BASE_URL = "auto"
|
| 45 |
+
AI_TEMPERATURE = 0.75
|
| 46 |
|
| 47 |
AI_MAX_TOKENS = 1200
|
| 48 |
AI_TIMEOUT_SEC = 120
|
|
|
|
| 403 |
|
| 404 |
AI_PROMPT_SYSTEM_BASE = (
|
| 405 |
"You are a professional manga translator and dialogue localizer.\n"
|
| 406 |
+
"1. Read the input text. Be aware that the text comes from OCR and may contain typos, missing characters, or misread punctuation.\n"
|
| 407 |
+
"2. Crucial: Pieces of text might be split into sub-paragraphs. Combine them contextually to form complete, logical sentences before translating.\n"
|
| 408 |
+
"3. Infer the correct words from the context before translating.\n"
|
| 409 |
+
"4. Rewrite each paragraph as natural dialogue in the target language while preserving meaning, tone, intent, and character voice.\n"
|
| 410 |
+
"5. Keep lines concise for speech bubbles. Preserve emphasis (… ! ?). Do not over-explain.\n"
|
| 411 |
+
"6. If the input is already in the target language, improve it without changing meaning."
|
| 412 |
)
|
| 413 |
|
| 414 |
AI_LANG_STYLE = {
|