maxza258 commited on
Commit
8e75de9
·
verified ·
1 Parent(s): 67d286e

Update backend/lens_core.py

Browse files
Files changed (1) hide show
  1. 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 = "auto"
43
- AI_MODEL = "auto"
44
  AI_BASE_URL = "auto"
45
- AI_TEMPERATURE = 0.2
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
- "Rewrite each paragraph as natural dialogue in the target language while preserving meaning, tone, intent, and character voice.\n"
407
- "Keep lines concise for speech bubbles. Do not add new information. Do not omit meaning. Do not explain.\n"
408
- "Preserve emphasis (… ! ?). Avoid excessive punctuation.\n"
409
- "If the input is already in the target language, improve it (dialogue polish) without changing meaning."
 
 
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 = {