MacOS 沉浸式翻译使用本地大模型(Ollama)临时解决方案

68 天前
 huiyanpohundh123

TranslationService

沉浸式翻译本地大模型临时解决方案

github: https://github.com/tinuv/TranslationService

如果有用麻烦点个🌟

0. 打开沉浸式翻译的实验功能,使用自定义 API,使用自定义地址:http://localhost:8080/translate

1. 直接使用命令行

从源码编译后直接在命令行使用/path/to/TranslationService,或者从仓库的 release 下载编译后的二进制文件

2. 使用launchctl长期使用

  1. 新建TranslationService.plist,并写入

       <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd
    ">
    <plist version="1.0">
        <dict>
            <key>KeepAlive</key>
            <dict>
                <key>SuccessfulExit</key>
                <false/>
            </dict>
            <key>Label</key>
            <string>TranslationService</string>
            <key>ProgramArguments</key>
            <array>
                <string>/Users/tinuv/Developer/Apple/TranslationService/TranslationService/TranslationService</string>
            </array>
            <key>RunAtLoad</key>
            <true/>
        </dict>
    </plist>
    

    其中/Users/tinuv/Developer/Apple/TranslationService/TranslationService/TranslationService替换为自己的 TranslationService 路径

  2. 将文件移动到/Library/LaunchDaemons/,sudo mv /path/to/TranslationService.plist /Library/LaunchDaemons/TranslationService.plist

  3. 开机自启sudo launchctl load -w /Library/LaunchDaemons/TranslationService.plist

  4. 卸载自启动sudo launchctl unload -w /Library/LaunchDaemons/TranslationService.plist 或直接删除此文件

2555 次点击
所在节点    程序员
4 条回复
mortal
68 天前
好奇为啥还要套一层?沉浸式翻译不是可以直接用 openAI 方式接入 Ollama 吗
huiyanpohundh123
68 天前
@mortal 就是不支持啊 但是 github 已经有人提 issue 现在作为临时解决方案
Yzh361
67 天前
这么麻烦… 多亏用的是 chromeOS
goodryb
39 天前

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1020155

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX