1028.py
All checks were successful
test / job_1 (push) Successful in 1m15s

This commit is contained in:
298977887 2024-10-28 21:20:02 +08:00
parent a2258f374b
commit 86619123c8

View File

@ -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
}