Merge branch 'master' into frontier
This commit is contained in:
		
						commit
						20bc51d747
					
				@ -82,14 +82,14 @@ def get_core_functions():
 | 
				
			|||||||
        },
 | 
					        },
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        "学术中英互译": {
 | 
					        "学术英中互译": {
 | 
				
			||||||
            "Prefix":   r"I want you to act as a scientific English-Chinese translator, "
 | 
					            "Prefix":   r"I want you to act as a scientific English-Chinese translator, " +
 | 
				
			||||||
                        r"I will provide you with some paragraphs in one language "
 | 
					                        r"I will provide you with some paragraphs in one language " +
 | 
				
			||||||
                        r"and your task is to accurately and academically translate the paragraphs only into the other language. "
 | 
					                        r"and your task is to accurately and academically translate the paragraphs only into the other language. " +
 | 
				
			||||||
                        r"Do not repeat the original provided paragraphs after translation. "
 | 
					                        r"Do not repeat the original provided paragraphs after translation. " +
 | 
				
			||||||
                        r"You should use artificial intelligence tools, "
 | 
					                        r"You should use artificial intelligence tools, " +
 | 
				
			||||||
                        r"such as natural language processing, and rhetorical knowledge "
 | 
					                        r"such as natural language processing, and rhetorical knowledge " +
 | 
				
			||||||
                        r"and experience about effective writing techniques to reply. "
 | 
					                        r"and experience about effective writing techniques to reply. " +
 | 
				
			||||||
                        r"I'll give you my paragraphs as follows, tell me what language it is written in, and then translate:" + "\n\n",
 | 
					                        r"I'll give you my paragraphs as follows, tell me what language it is written in, and then translate:" + "\n\n",
 | 
				
			||||||
            "Suffix":   r"",
 | 
					            "Suffix":   r"",
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
				
			|||||||
@ -50,6 +50,11 @@ def predict(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[], system_promp
 | 
				
			|||||||
        yield from update_ui_lastest_msg(f"请配置 GEMINI_API_KEY。", chatbot=chatbot, history=history, delay=0)
 | 
					        yield from update_ui_lastest_msg(f"请配置 GEMINI_API_KEY。", chatbot=chatbot, history=history, delay=0)
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # 适配润色区域
 | 
				
			||||||
 | 
					    if additional_fn is not None:
 | 
				
			||||||
 | 
					        from core_functional import handle_core_functionality
 | 
				
			||||||
 | 
					        inputs, history = handle_core_functionality(additional_fn, inputs, history, chatbot)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if "vision" in llm_kwargs["llm_model"]:
 | 
					    if "vision" in llm_kwargs["llm_model"]:
 | 
				
			||||||
        have_recent_file, image_paths = have_any_recent_upload_image_files(chatbot)
 | 
					        have_recent_file, image_paths = have_any_recent_upload_image_files(chatbot)
 | 
				
			||||||
        def make_media_input(inputs, image_paths): 
 | 
					        def make_media_input(inputs, image_paths): 
 | 
				
			||||||
 | 
				
			|||||||
@ -42,7 +42,7 @@ def predict(inputs, llm_kwargs, plugin_kwargs, chatbot, history=[], system_promp
 | 
				
			|||||||
    try:
 | 
					    try:
 | 
				
			||||||
        check_packages(["zhipuai"])
 | 
					        check_packages(["zhipuai"])
 | 
				
			||||||
    except:
 | 
					    except:
 | 
				
			||||||
        yield from update_ui_lastest_msg(f"导入软件依赖失败。使用该模型需要额外依赖,安装方法```pip install --upgrade zhipuai```。",
 | 
					        yield from update_ui_lastest_msg(f"导入软件依赖失败。使用该模型需要额外依赖,安装方法```pip install zhipuai==1.0.7```。",
 | 
				
			||||||
                                         chatbot=chatbot, history=history, delay=0)
 | 
					                                         chatbot=chatbot, history=history, delay=0)
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user