support azure in multi-lang translation
This commit is contained in:
		
							parent
							
								
									892ccb14c7
								
							
						
					
					
						commit
						916b2e8aa7
					
				@ -2903,5 +2903,107 @@
 | 
				
			|||||||
    "高优先级": "High priority",
 | 
					    "高优先级": "High priority",
 | 
				
			||||||
    "请配置ZHIPUAI_API_KEY": "Please configure ZHIPUAI_API_KEY",
 | 
					    "请配置ZHIPUAI_API_KEY": "Please configure ZHIPUAI_API_KEY",
 | 
				
			||||||
    "单个azure模型": "Single Azure model",
 | 
					    "单个azure模型": "Single Azure model",
 | 
				
			||||||
    "预留参数 context 未实现": "Reserved parameter 'context' not implemented"
 | 
					    "预留参数 context 未实现": "Reserved parameter 'context' not implemented",
 | 
				
			||||||
 | 
					    "在输入区输入临时API_KEY后提交": "Submit after entering temporary API_KEY in the input area",
 | 
				
			||||||
 | 
					    "鸟": "Bird",
 | 
				
			||||||
 | 
					    "图片中需要修改的位置用橡皮擦擦除为纯白色": "Erase the areas in the image that need to be modified with an eraser to pure white",
 | 
				
			||||||
 | 
					    "└── PDF文档精准解析": "└── Accurate parsing of PDF documents",
 | 
				
			||||||
 | 
					    "└── ALLOW_RESET_CONFIG 是否允许通过自然语言描述修改本页的配置": "└── ALLOW_RESET_CONFIG Whether to allow modifying the configuration of this page through natural language description",
 | 
				
			||||||
 | 
					    "等待指令": "Waiting for instructions",
 | 
				
			||||||
 | 
					    "不存在": "Does not exist",
 | 
				
			||||||
 | 
					    "选择游戏": "Select game",
 | 
				
			||||||
 | 
					    "本地大模型示意图": "Local large model diagram",
 | 
				
			||||||
 | 
					    "无视此消息即可": "You can ignore this message",
 | 
				
			||||||
 | 
					    "即RGB=255": "That is, RGB=255",
 | 
				
			||||||
 | 
					    "如需追问": "If you have further questions",
 | 
				
			||||||
 | 
					    "也可以是具体的模型路径": "It can also be a specific model path",
 | 
				
			||||||
 | 
					    "才会起作用": "Will take effect",
 | 
				
			||||||
 | 
					    "下载失败": "Download failed",
 | 
				
			||||||
 | 
					    "网页刷新后失效": "Invalid after webpage refresh",
 | 
				
			||||||
 | 
					    "crazy_functions.互动小游戏-": "crazy_functions.Interactive mini game-",
 | 
				
			||||||
 | 
					    "右对齐": "Right alignment",
 | 
				
			||||||
 | 
					    "您可以调用下拉菜单中的“LoadConversationHistoryArchive”还原当下的对话": "You can use the 'LoadConversationHistoryArchive' in the drop-down menu to restore the current conversation",
 | 
				
			||||||
 | 
					    "左对齐": "Left alignment",
 | 
				
			||||||
 | 
					    "使用默认的 FP16": "Use default FP16",
 | 
				
			||||||
 | 
					    "一小时": "One hour",
 | 
				
			||||||
 | 
					    "从而方便内存的释放": "Thus facilitating memory release",
 | 
				
			||||||
 | 
					    "如何临时更换API_KEY": "How to temporarily change API_KEY",
 | 
				
			||||||
 | 
					    "请输入 1024x1024-HD": "Please enter 1024x1024-HD",
 | 
				
			||||||
 | 
					    "使用 INT8 量化": "Use INT8 quantization",
 | 
				
			||||||
 | 
					    "3. 输入修改需求": "3. Enter modification requirements",
 | 
				
			||||||
 | 
					    "刷新界面 由于请求gpt需要一段时间": "Refreshing the interface takes some time due to the request for gpt",
 | 
				
			||||||
 | 
					    "随机小游戏": "Random mini game",
 | 
				
			||||||
 | 
					    "那么请在下面的QWEN_MODEL_SELECTION中指定具体的模型": "So please specify the specific model in QWEN_MODEL_SELECTION below",
 | 
				
			||||||
 | 
					    "表值": "Table value",
 | 
				
			||||||
 | 
					    "我画你猜": "I draw, you guess",
 | 
				
			||||||
 | 
					    "狗": "Dog",
 | 
				
			||||||
 | 
					    "2. 输入分辨率": "2. Enter resolution",
 | 
				
			||||||
 | 
					    "鱼": "Fish",
 | 
				
			||||||
 | 
					    "尚未完成": "Not yet completed",
 | 
				
			||||||
 | 
					    "表头": "Table header",
 | 
				
			||||||
 | 
					    "填localhost或者127.0.0.1": "Fill in localhost or 127.0.0.1",
 | 
				
			||||||
 | 
					    "请上传jpg格式的图片": "Please upload images in jpg format",
 | 
				
			||||||
 | 
					    "API_URL_REDIRECT填写格式是错误的": "The format of API_URL_REDIRECT is incorrect",
 | 
				
			||||||
 | 
					    "├──  RWKV的支持见Wiki": "Support for RWKV is available in the Wiki",
 | 
				
			||||||
 | 
					    "如果中文Prompt效果不理想": "If the Chinese prompt is not effective",
 | 
				
			||||||
 | 
					    "/SEAFILE_LOCAL/50503047/我的资料库/学位/paperlatex/aaai/Fu_8368_with_appendix": "/SEAFILE_LOCAL/50503047/My Library/Degree/paperlatex/aaai/Fu_8368_with_appendix",
 | 
				
			||||||
 | 
					    "只有当AVAIL_LLM_MODELS包含了对应本地模型时": "Only when AVAIL_LLM_MODELS contains the corresponding local model",
 | 
				
			||||||
 | 
					    "选择本地模型变体": "Choose the local model variant",
 | 
				
			||||||
 | 
					    "如果您确信自己没填错": "If you are sure you haven't made a mistake",
 | 
				
			||||||
 | 
					    "PyPDF2这个库有严重的内存泄露问题": "PyPDF2 library has serious memory leak issues",
 | 
				
			||||||
 | 
					    "整理文件集合 输出消息": "Organize file collection and output message",
 | 
				
			||||||
 | 
					    "没有检测到任何近期上传的图像文件": "No recently uploaded image files detected",
 | 
				
			||||||
 | 
					    "游戏结束": "Game over",
 | 
				
			||||||
 | 
					    "调用结束": "Call ended",
 | 
				
			||||||
 | 
					    "猫": "Cat",
 | 
				
			||||||
 | 
					    "请及时切换模型": "Please switch models in time",
 | 
				
			||||||
 | 
					    "次中": "In the meantime",
 | 
				
			||||||
 | 
					    "如需生成高清图像": "If you need to generate high-definition images",
 | 
				
			||||||
 | 
					    "CPU 模式": "CPU mode",
 | 
				
			||||||
 | 
					    "项目目录": "Project directory",
 | 
				
			||||||
 | 
					    "动物": "Animal",
 | 
				
			||||||
 | 
					    "居中对齐": "Center alignment",
 | 
				
			||||||
 | 
					    "请注意拓展名需要小写": "Please note that the extension name needs to be lowercase",
 | 
				
			||||||
 | 
					    "重试第": "Retry",
 | 
				
			||||||
 | 
					    "实验性功能": "Experimental feature",
 | 
				
			||||||
 | 
					    "猜错了": "Wrong guess",
 | 
				
			||||||
 | 
					    "打开你的代理软件查看代理协议": "Open your proxy software to view the proxy agreement",
 | 
				
			||||||
 | 
					    "您不需要再重复强调该文件的路径了": "You don't need to emphasize the file path again",
 | 
				
			||||||
 | 
					    "请阅读": "Please read",
 | 
				
			||||||
 | 
					    "请直接输入您的问题": "Please enter your question directly",
 | 
				
			||||||
 | 
					    "API_URL_REDIRECT填错了": "API_URL_REDIRECT is filled incorrectly",
 | 
				
			||||||
 | 
					    "谜底是": "The answer is",
 | 
				
			||||||
 | 
					    "第一个模型": "The first model",
 | 
				
			||||||
 | 
					    "你猜对了!": "You guessed it right!",
 | 
				
			||||||
 | 
					    "已经接收到您上传的文件": "The file you uploaded has been received",
 | 
				
			||||||
 | 
					    "您正在调用“图像生成”插件": "You are calling the 'Image Generation' plugin",
 | 
				
			||||||
 | 
					    "刷新界面 界面更新": "Refresh the interface, interface update",
 | 
				
			||||||
 | 
					    "如果之前已经初始化了游戏实例": "If the game instance has been initialized before",
 | 
				
			||||||
 | 
					    "文件": "File",
 | 
				
			||||||
 | 
					    "老鼠": "Mouse",
 | 
				
			||||||
 | 
					    "列2": "Column 2",
 | 
				
			||||||
 | 
					    "等待图片": "Waiting for image",
 | 
				
			||||||
 | 
					    "使用 INT4 量化": "Use INT4 quantization",
 | 
				
			||||||
 | 
					    "from crazy_functions.互动小游戏 import 随机小游戏": "TranslatedText",
 | 
				
			||||||
 | 
					    "游戏主体": "TranslatedText",
 | 
				
			||||||
 | 
					    "该模型不具备上下文对话能力": "TranslatedText",
 | 
				
			||||||
 | 
					    "列3": "TranslatedText",
 | 
				
			||||||
 | 
					    "清理": "TranslatedText",
 | 
				
			||||||
 | 
					    "检查量化配置": "TranslatedText",
 | 
				
			||||||
 | 
					    "如果游戏结束": "TranslatedText",
 | 
				
			||||||
 | 
					    "蛇": "TranslatedText",
 | 
				
			||||||
 | 
					    "则继续该实例;否则重新初始化": "TranslatedText",
 | 
				
			||||||
 | 
					    "e.g. cat and 猫 are the same thing": "TranslatedText",
 | 
				
			||||||
 | 
					    "第三个模型": "TranslatedText",
 | 
				
			||||||
 | 
					    "如果你选择Qwen系列的模型": "TranslatedText",
 | 
				
			||||||
 | 
					    "列4": "TranslatedText",
 | 
				
			||||||
 | 
					    "输入“exit”获取答案": "TranslatedText",
 | 
				
			||||||
 | 
					    "把它放到子进程中运行": "TranslatedText",
 | 
				
			||||||
 | 
					    "列1": "TranslatedText",
 | 
				
			||||||
 | 
					    "使用该模型需要额外依赖": "TranslatedText",
 | 
				
			||||||
 | 
					    "再试试": "TranslatedText",
 | 
				
			||||||
 | 
					    "1. 上传图片": "TranslatedText",
 | 
				
			||||||
 | 
					    "保存状态": "TranslatedText",
 | 
				
			||||||
 | 
					    "GPT-Academic对话存档": "TranslatedText",
 | 
				
			||||||
 | 
					    "Arxiv论文精细翻译": "TranslatedText"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -182,12 +182,12 @@ cached_translation = read_map_from_json(language=LANG)
 | 
				
			|||||||
def trans(word_to_translate, language, special=False):
 | 
					def trans(word_to_translate, language, special=False):
 | 
				
			||||||
    if len(word_to_translate) == 0: return {}
 | 
					    if len(word_to_translate) == 0: return {}
 | 
				
			||||||
    from crazy_functions.crazy_utils import request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency
 | 
					    from crazy_functions.crazy_utils import request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency
 | 
				
			||||||
    from toolbox import get_conf, ChatBotWithCookies
 | 
					    from toolbox import get_conf, ChatBotWithCookies, load_chat_cookies
 | 
				
			||||||
    proxies, WEB_PORT, LLM_MODEL, CONCURRENT_COUNT, AUTHENTICATION, CHATBOT_HEIGHT, LAYOUT, API_KEY = \
 | 
					    
 | 
				
			||||||
        get_conf('proxies', 'WEB_PORT', 'LLM_MODEL', 'CONCURRENT_COUNT', 'AUTHENTICATION', 'CHATBOT_HEIGHT', 'LAYOUT', 'API_KEY')
 | 
					    cookies = load_chat_cookies()
 | 
				
			||||||
    llm_kwargs = {
 | 
					    llm_kwargs = {
 | 
				
			||||||
        'api_key': API_KEY,
 | 
					        'api_key': cookies['api_key'],
 | 
				
			||||||
        'llm_model': LLM_MODEL,
 | 
					        'llm_model': cookies['llm_model'],
 | 
				
			||||||
        'top_p':1.0, 
 | 
					        'top_p':1.0, 
 | 
				
			||||||
        'max_length': None,
 | 
					        'max_length': None,
 | 
				
			||||||
        'temperature':0.4,
 | 
					        'temperature':0.4,
 | 
				
			||||||
@ -245,15 +245,15 @@ def trans(word_to_translate, language, special=False):
 | 
				
			|||||||
def trans_json(word_to_translate, language, special=False):
 | 
					def trans_json(word_to_translate, language, special=False):
 | 
				
			||||||
    if len(word_to_translate) == 0: return {}
 | 
					    if len(word_to_translate) == 0: return {}
 | 
				
			||||||
    from crazy_functions.crazy_utils import request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency
 | 
					    from crazy_functions.crazy_utils import request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency
 | 
				
			||||||
    from toolbox import get_conf, ChatBotWithCookies
 | 
					    from toolbox import get_conf, ChatBotWithCookies, load_chat_cookies
 | 
				
			||||||
    proxies, WEB_PORT, LLM_MODEL, CONCURRENT_COUNT, AUTHENTICATION, CHATBOT_HEIGHT, LAYOUT, API_KEY = \
 | 
					    
 | 
				
			||||||
        get_conf('proxies', 'WEB_PORT', 'LLM_MODEL', 'CONCURRENT_COUNT', 'AUTHENTICATION', 'CHATBOT_HEIGHT', 'LAYOUT', 'API_KEY')
 | 
					    cookies = load_chat_cookies()
 | 
				
			||||||
    llm_kwargs = {
 | 
					    llm_kwargs = {
 | 
				
			||||||
        'api_key': API_KEY,
 | 
					        'api_key': cookies['api_key'],
 | 
				
			||||||
        'llm_model': LLM_MODEL,
 | 
					        'llm_model': cookies['llm_model'],
 | 
				
			||||||
        'top_p':1.0, 
 | 
					        'top_p':1.0, 
 | 
				
			||||||
        'max_length': None,
 | 
					        'max_length': None,
 | 
				
			||||||
        'temperature':0.1,
 | 
					        'temperature':0.4,
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    import random
 | 
					    import random
 | 
				
			||||||
    N_EACH_REQ = random.randint(16, 32)
 | 
					    N_EACH_REQ = random.randint(16, 32)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user