Comments (5)
是当时接口的问题吗?我试了一下可以正常翻译欸
2024-05-29 13:19:46,152 - INFO - 翻译消息: 不过我们这边异地首办应该是可以的,我同学都办过
2024-05-29 13:19:48,365 - INFO - 翻译从 zh 至 en 耗时: 2.211108922958374
2024-05-29 13:19:48,366 - INFO - 翻译耗时: 2.2134783267974854
![image](https://private-user-images.githubusercontent.com/131764215/334970970-eee274be-5a97-40a6-99f0-6a6b59694725.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3MzE1NzIsIm5iZiI6MTcyNDczMTI3MiwicGF0aCI6Ii8xMzE3NjQyMTUvMzM0OTcwOTcwLWVlZTI3NGJlLTVhOTctNDBhNi05OWYwLTZhNmI1OTY5NDcyNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODI3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyN1QwNDAxMTJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wZjdjMjQ2YTlkYTM1NWU0ZThjZDIwM2Q5MmEzMjk4YTEzMDdmZGU2OTY3YjEzNDA5OWM5YmE4MmQzY2I3OWRhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.96qRM7Tdein4SVGpVbRSw8Y2B3znWaBwE85club-xlw)
from teletrans.
怪了,即使现在也不行。
~ [email protected]
❯ sudo cat /var/lib/docker/volumes/teletrans_love4taylor/_data/config.json
{
"api_id": "******",
"api_hash": "*******",
"target_config": {},
"openai": {
"enable": true,
"api_key": "sk-*******",
"url": "https://api.deepseek.com/chat/completions",
"model": "deepseek-chat"
}
}
镜像版本是 ghcr.io/ihategfw/teletrans:latest@sha256:ece6fb46ab4bb54e553273b7a4b75963312efdd5a9d23cd4ac416d810f4b9b2d
from teletrans.
啊原来你说的是 deepseek 啊,我会错意了
我倾向于认为是因为 deepseek-chat 这个模型比较笨,不能理解 prompt 或者说你的句子的意思
在代码里 hard code 了一句 prompt,我测试了 gpt-3.5 / gpt-4 都能正确翻译你的句子
If my text cannot be translated or contains nonsencial content, just repeat my words precisely. As an American English expert, you\'ll help users express themselves clearly. You\'re not just translating, but rephrasing to maintain clarity. Use plain English and common idioms, and vary sentence lengths for natural flow. Avoid regional expressions. Respond with the translated sentence.
或许我应该把这句 prompt 也放到配置文件里
from teletrans.
改了下 py,把 prompt 以中文表述喂给 deepseek 就能翻译了。如果您要移到配置文件的话,麻烦顺便给温度也移过去吧。另外好奇,只有目的语言是 en 才用 openai 是因为它中译英很差?
payload = {
'messages': [
{
'role': 'system',
'content':'如果我的文本无法翻译或包含无意义内容,请准确重复我的话。作为美式英语专家,您将帮助用户清晰表达自己。您不仅仅是翻译,而是重新表述以保持清晰度。使用简单英语和
常用习语,并变化句子长度以实现自然流畅。避免使用地区性表达。请回复已翻译的句子。'
},
{
'role': 'user',
'content': text,
}
],
'stream': False,
'model': openai_model,
'temperature': 1.1,
'presence_penalty': 0,
'frequency_penalty': 0,
'top_p': 1
}
![image](https://private-user-images.githubusercontent.com/6081912/335802237-24916853-f0cd-4c52-b6f6-e372af8a282a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3MzE1NzIsIm5iZiI6MTcyNDczMTI3MiwicGF0aCI6Ii82MDgxOTEyLzMzNTgwMjIzNy0yNDkxNjg1My1mMGNkLTRjNTItYjZmNi1lMzcyYWY4YTI4MmEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjdUMDQwMTEyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZGY0ZTkyNmUxMDZlNTJmZTk4YjY1NDgwZTgyMjBjMDFlNGIzODVkYTk2MTE4ZTJmYzA0MTk3OTJhMDBlNDYxNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.QVVn6ScmObpH6CbKH_LySH_mRIvK_7QBVFnMz69wnLI)
from teletrans.
另外好奇,只有目的语言是 en 才用 openai 是因为它中译英很差?
因为我只有这个使用场景😂,设计的时候没有考虑很周到。
同时考虑到不同的目标语言可能需要不同的 prompt ,不知道你有没有什么想法?
from teletrans.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teletrans.