Giter Club home page Giter Club logo

Comments (5)

ihategfw avatar ihategfw commented on August 27, 2024

是当时接口的问题吗?我试了一下可以正常翻译欸

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

from teletrans.

love4taylor avatar love4taylor commented on August 27, 2024

怪了,即使现在也不行。

~ [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.

ihategfw avatar ihategfw commented on August 27, 2024

啊原来你说的是 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.

love4taylor avatar love4taylor commented on August 27, 2024

改了下 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

from teletrans.

ihategfw avatar ihategfw commented on August 27, 2024

另外好奇,只有目的语言是 en 才用 openai 是因为它中译英很差?

因为我只有这个使用场景😂,设计的时候没有考虑很周到。
同时考虑到不同的目标语言可能需要不同的 prompt ,不知道你有没有什么想法?

from teletrans.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.