This commit is contained in:
parent
a2258f374b
commit
86619123c8
@ -50,9 +50,14 @@ else:
|
||||
logging.info("开始调用 llama3.1 模型进行翻译")
|
||||
translation_api_url = "https://ollama.aoun.ltd/api/generate"
|
||||
headers = {"Content-Type": "application/json"}
|
||||
# 设置翻译的 prompt,强调技术文档风格
|
||||
prompt = f"""
|
||||
这是OpenWrt的更新日志,作为一位熟悉技术文档、硬件描述、设备树配置的专业翻译员,请准确且简洁地将以下内容从英文翻译成简体中文。注意保留术语的专业性和准确性,避免不必要的意译和简化,以下是需要翻译的内容:
|
||||
{all_commits_text}
|
||||
"""
|
||||
payload = {
|
||||
"model": "llama3.1",
|
||||
"prompt": f"请翻译这个内容:{all_commits_text}",
|
||||
"prompt": prompt,
|
||||
"stream": False
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user