Spaces:
Sleeping
Sleeping
Update backend/lens_core.py
Browse files38 unmodified lines39404142434445464748354 unmodified lines40340440540640740840941041141238 unmodified linesAI_CACHE = FalseAI_CACHE_PATH = "ai_cache.json"AI_PATH_OVERLAY = "overlay_ai.png"AI_PROVIDER = "auto"AI_MODEL = "auto"AI_BASE_URL = "auto"AI_TEMPERATURE = 0.2AI_MAX_TOKENS = 1200AI_TIMEOUT_SEC = 120354 unmodified linesAI_PROMPT_SYSTEM_BASE = ("You are a professional manga translator and dialogue localizer.\n""Rewrite each paragraph as natural dialogue in the target language while preserving meaning, tone, intent, and character voice.\n""Keep lines concise for speech bubbles. Do not add new information. Do not omit meaning. Do not explain.\n""Preserve emphasis (… ! ?). Avoid excessive punctuation.\n""If the input is already in the target language, improve it (dialogue polish) without changing meaning.")AI_LANG_STYLE = {38 unmodified lines39404142434445464748354 unmodified lines40340440540640740840941041141241341438 unmodified linesAI_CACHE = FalseAI_CACHE_PATH = "ai_cache.json"AI_PATH_OVERLAY = "overlay_ai.png"AI_PROVIDER = "huggingface"AI_MODEL = "google/gemma-3-27b-it"AI_BASE_URL = "auto"AI_TEMPERATURE = 0.75AI_MAX_TOKENS = 1200AI_TIMEOUT_SEC = 120354 unmodified linesAI_PROMPT_SYSTEM_BASE = ("You are a professional manga translator and dialogue localizer.\n""1. Read the input text. Be aware that the text comes from OCR and may contain typos, missing characters, or misread punctuation.\n""2. Crucial: Pieces of text might be split into sub-paragraphs. Combine them contextually to form complete, logical sentences before translating.\n""3. Infer the correct words from the context before translating.\n""4. Rewrite each paragraph as natural dialogue in the target language while preserving meaning, tone, intent, and character voice.\n""5. Keep lines concise for speech bubbles. Preserve emphasis (… ! ?). Do not over-explain.\n""6. If the input is already in the target language, improve it without changing meaning.")AI_LANG_STYLE = {
backend/lens_core.py+9-7