Commit Graph

139 Commits

Author SHA1 Message Date
misyaguziya
306f0af734 controller: 翻訳モデル選択時にモデル適用とクライアント更新を確実に行うよう修正
- デフォルト選択時および明示的なモデル設定時に model.setTranslatorXModel(...) を呼び出し、モデル状態を確実に反映
- OpenAI/LMStudio/Ollama/Plamo/Gemini/Ollama でクライアント更新を適切な箇所に追加して整合性を向上

mainloop: LMStudio/Ollama 接続チェックのエンドポイントを run 系に変更、ローマ字変換関連を追加
- "/get/data/*_connection" → "/run/*_connection" に変更(LMStudio/Ollama)
- ローマ字変換(convert_message_to_romaji) のマッピングを追加(取得/有効化/無効化)

translation_ollama: 認証チェックのエンドポイント呼び出しを修正
- base_url + "/api/ping" ではなく base_url 直下に対して GET を行うよう変更(環境による応答差異に対応)
2025-10-20 03:48:41 +09:00
misyaguziya
83e72b37cc LMStudio 接続チェックとモデル選択処理を追加・強化、mainloop にエンドポイント追加、LMStudio/Ollama のモデル取得を例外耐性化
- Controller に checkTranslatorLMStudioConnection を追加し、接続成功時に SELECTABLE_TRANSLATION_ENGINE_STATUS や SELECTABLE_LMSTUDIO_MODEL_LIST を更新、選択モデルのフォールバック設定・クライアント更新・UI 更新呼び出しを行うよう実装
- setTranslatorLMStudioURL を接続成功時にモデルリスト/ステータス更新や選択モデルのフォールバック処理を行うよう拡張
- checkTranslatorOllamaConnection 成功時にも SELECTABLE_TRANSLATION_ENGINE_STATUS/モデルリスト更新、選択モデルフォールバック、クライアント更新、UI 更新呼び出しを追加
- mainloop に /get/data/lmstudio_connection エンドポイントを追加して LMStudio 接続チェックを公開
- translation_lmstudio.py と translation_ollama.py のモデル取得処理を try/except で保護し、例外時は空リストを返すよう修正(接続失敗やレスポンス異常に対する耐性向上)
2025-10-20 00:38:38 +09:00
misyaguziya
e71bf17e13 各翻訳クライアントで supported_languages を YAML から translation_lang に移行・参照するよう修正、プロンプトYAMLの重複した supported_languages ブロックを削除、LMStudio のデフォルト URL を /v1 に変更、mainloop に LMStudio/Ollama のモデル関連エンドポイントと run_mapping を追加、Controller 内の Ollama 表記のtypo(Lollama→Ollama)を修正してメソッド名・ログ文を更新、各クライアントで translation_languages のフォールバック import を追加 2025-10-19 22:07:58 +09:00
misyaguziya
6596743b6b 翻訳言語定義を YAML に移行しロード処理を実装
- 言語マッピングを src-python/models/translation/languages/languages.yml として追加
- translation_languages.py を全面リファクタ:YAML から読み込み、構造検証、スレッドロック、キャッシュ対応を導入
- config.py に loadTranslationLanguages のインポート/フォールバックを追加し、Config 初期化時に言語定義を読み込むよう変更
- PyYAML を requirements.txt / requirements_cuda.txt に追記
- PyInstaller spec (backend.spec / backend_cuda.spec) に言語ファイル配布先を追加
- translation_ollama.py の loadPromptConfig 呼び出しを修正(ファイル名を明示)
2025-10-18 23:16:22 +09:00
misyaguziya
7e7b3505a1 LMStudio と Ollama の翻訳バックエンドを追加・統合。
- config: SELECTABLE_/SELECTED_ の LMStudio/Ollama 項目と LMSTUDIO_URL を追加。
- Controller: LMStudio/Ollama の認証チェック、URL取得/設定、モデル一覧取得/設定のエンドポイントを実装。
- Model/Translator: LMStudio/Ollama 用の認証・モデル一覧・モデル設定・クライアント更新メソッドを追加し、翻訳処理の選択肢に対応。
- translation_* クライアント: 各クライアントでのプロンプト読み込み処理を共通化し、translation_utils.loadPromptConfig を利用するようにリファクタ。
- translation_languages: LMStudio/Ollama 用の言語マッピングを追加。
2025-10-17 21:48:44 +09:00
misyaguziya
965bee818a LM Studio と Ollama の翻訳クライアントとプロンプトを追加、requirements に langchain-ollama を追記
- src-python/models/translation に LM Studio 用 (translation_lmstudio.py / translation_lmstudio.yml) を追加
- Ollama 用クライアント (translation_ollama.py / translation_ollama.yml) を追加
- 各クライアントでプロンプト YAML から system_prompt / supported_languages を読み込み、認証チェック・モデル一覧取得・モデル設定・クライアント更新・translate 呼び出しを実装
- requirements.txt と requirements_cuda.txt に langchain-ollama==0.3.10 を追記
2025-10-17 15:58:50 +09:00
misyaguziya
526fd4d5aa 翻訳バックエンドを拡張・リファクタリング:OpenAI/Plamo/Gemini クライアントを追加・改修し、プロンプトを YAML から読み込むように変更。各クライアントでモデル一覧取得・認証・クライアント更新機能を実装し、Translator/Model 層の対応メソッドを追加。Controller と mainloop にプラモ・ジェミニ・OpenAI の認証/モデル操作エンドポイントを追加・整備。config のモデル/API設定をプロパティ化して既定値を None に変更し、選択肢リストを初期化。translation_languages に OpenAI 用マッピングを追加。requirements ファイルの依存記述を調整。 2025-10-16 18:09:08 +09:00
misyaguziya
f8466bd6e4 翻訳APIの認証ロジックを改善し、YAMLファイルからプロンプト設定を読み込む機能を追加。新しいフォントファイルを追加し、データパスを更新。 2025-10-15 18:50:26 +09:00
misyaguziya
7d0f63c118 CTranslate2に対応する翻訳言語の設定を追加し、翻訳ロジックを更新 2025-10-14 23:15:49 +09:00
misyaguziya
6fc89fbb3e Merge branch 'develop' into translate_api
# Conflicts:
#	requirements.txt
#	requirements_cuda.txt
#	src-python/config.py
#	src-python/mainloop.py
#	src-python/model.py
#	src-python/models/osc/osc.py
#	src-python/models/translation/translation_languages.py
#	src-python/models/translation/translation_translator.py
#	src-python/models/translation/translation_utils.py
2025-10-14 12:47:47 +09:00
misyaguziya
914789c9cb mainloopのスレッド管理を改善し、マルチワーカー化を実装。デバイス管理の初期化を遅延させ、エラーハンドリングを強化。ドキュメントを更新し、設定の変更点を明示化。 2025-10-13 08:28:27 +09:00
misyaguziya
35e8d7dda9 スレッドセーフなトークナイザーアクセスのためにロックを追加。トークナイザーの呼び出し時に発生する可能性のあるRuntimeErrorを防ぐために、アクセスを直列化。 2025-10-09 18:43:12 +09:00
misyaguziya
944577eaf4 OSCモジュールのドキュメントを更新し、使用例や注意点を追加。型注釈を強化し、エラーハンドリングを改善。OSCHandlerクラスの初期化メソッドを修正し、サービスのアドバタイズ中の例外処理を追加。テストファイルを新規作成し、OSCモジュールのインポートテストを追加。 2025-10-09 17:39:52 +09:00
misyaguziya
690a2f081b ドキュメントを更新し、型注釈を追加してコードの可読性とメンテナンス性を向上。各モジュールの使用例や依存関係を明示化し、エラーハンドリングを改善。 2025-10-09 17:35:55 +09:00
misyaguziya
b26129af68 翻訳モジュールのドキュメントを更新し、セットアップ手順やAPI使用例を追加。型注釈を強化し、関数の戻り値を明示化。エラーハンドリングを改善し、コードの可読性を向上。 2025-10-09 17:30:48 +09:00
misyaguziya
7d24b3839c 型注釈を追加し、関数の戻り値を明示化。コードの可読性と型安全性を向上。 2025-10-09 17:07:21 +09:00
misyaguziya
7255722b67 ウォッチドッグのドキュメントを更新し、使用例を追加。型注釈とエラーハンドリングの改善を反映。 2025-10-09 17:01:31 +09:00
misyaguziya
569d8e3f76 [ref] overlayのリファクタリングとテストを追加 2025-10-09 16:43:41 +09:00
misyaguziya
c1cf78cda4 [改善] 型注釈の追加とドキュメントの更新
- config.py, controller.py, model.py, mainloop.py, utils.py での型注釈の追加
- CODING_RULES.md と api.md のドキュメントを更新
- 不要なコードの削除とリファクタリング
2025-10-09 13:34:05 +09:00
misyaguziya
78a580f521 OSCQueryの名前解決のためservice名をユニークに変更
service_nameを "VRCT" -> f"VRCT:{UTC}"
2025-10-08 13:01:16 +09:00
misyaguziya
6c655b6043 [Update] OverlayImage: Improve font loading logic with error handling for font file paths 2025-10-07 19:01:55 +09:00
misyaguziya
a167e57ff0 [Update] Test: Add translation tests for all language pairs and log results
[Update] remove unsupported langs
2025-10-07 13:33:04 +09:00
misyaguziya
4572aee2b7 [Update] Controller and Model: Refactor translation device management and add parameter change tracking 2025-10-06 16:40:05 +09:00
misyaguziya
ca07aef201 [Update] Translator: Add check to return original message if source and target languages are the same 2025-10-05 17:15:25 +09:00
misyaguziya
3ee7246224 [Feature] Transliterator: Implement contextual transliteration rules and integrate with analysis method 2025-10-05 16:18:58 +09:00
misyaguziya
7b1e9136ee [Update] Transliterator: Enhance transliteration control and improve tokenizer initialization 2025-10-04 22:25:55 +09:00
misyaguziya
fe3fea34ff [Cleanup] Transliterator: Remove debug print statement from analyze method 2025-10-02 22:58:13 +09:00
misyaguziya
e32e5c1b5f [Update] Transliterator: Change tokenizer mode to SplitMode.C and enhance analyze method for better reading assignment 2025-09-29 10:15:03 +09:00
Sakamoto Shiina
e7cd872fcc Merge branch 'bugfix_compute_type' into develop 2025-09-28 02:10:23 +09:00
misyaguziya
46584a0e3e Merge branch 'bugfix_overlay' into develop 2025-09-19 22:50:10 +09:00
misyaguziya
c171588ba9 [bugfix] Chat機能より改行を含む文章を送信した場合に、マルチラインのoverlayの表示に失敗する問題を修正 2025-09-19 22:49:48 +09:00
misyaguziya
4617954928 [Add] Implement Transliterator class and katakana to Hepburn conversion function 2025-09-17 14:09:36 +09:00
misyaguziya
fad01f6f90 [Change] ファイル名を変更 2025-09-17 11:26:44 +09:00
misyaguziya
245855d0ca [Update] Add compute type management for CTranslate2 and Whisper models 2025-09-17 10:35:34 +09:00
misyaguziya
224eaf3cef [Add] translation_gemini: Integrate Gemini translation model and authentication; [Update] controller: Implement methods for managing Gemini models and auth keys; [Update] mainloop: Add routes for Gemini model and auth key management; [Update] translation: Enhance Translator class for Gemini API support; [Update] translation_languages: Add Gemini language mappings 2025-09-15 17:42:09 +09:00
misyaguziya
d3c206fb26 [Add] Implement Transliterator class for kanji and okurigana analysis; update requirements and spec files 2025-09-15 05:33:30 +09:00
misyaguziya
0d121ecaad [Update] Enhance kanji and okurigana processing in Transliterator class 2025-09-15 05:22:57 +09:00
misyaguziya
2efedfb572 [Add] Implement transliterator and katakana to Hepburn conversion functions 2025-09-15 05:00:24 +09:00
misyaguziya
e3555d204e [Update] requirements: Add langchain-google-genai to dependencies; [Add] translation_gemini: Implement GeminiClient for translation functionality 2025-09-12 14:40:35 +09:00
misyaguziya
4e53584cff [Update] mainloop: Improve receiver loop to handle empty input and add stop message
[Update] osc: Refactor OSC query service initialization to run in a separate thread
2025-09-11 23:11:39 +09:00
misyaguziya
bc269bc1fb [Update] translation: Integrate Plamo API support with model selection and authentication features 2025-09-11 14:15:26 +09:00
misyaguziya
f5ebcd7bd8 [Update] translation: Add Plamo API support with authentication and translation functionality 2025-09-10 17:52:42 +09:00
misyaguziya
83a61e2e87 [Update] translation: Add support for new translation models and improve weight handling 2025-09-08 16:27:47 +09:00
misyaguziya
6fb7ecbc52 [Update] translation_utils.py: Refactor weight handling and improve error logging
add translate model
- jncraton/m2m100_418M-ct2-int8
- jncraton/m2m100_1.2B-ct2-int8
- OpenNMT/nllb-200-3.3B-ct2-int8
- OpenNMT/nllb-200-distilled-1.3B-ct2-int8
2025-09-07 23:59:20 +09:00
google-labs-jules[bot]
172617a523 Fix: Enhance logging for OSError and prevent AttributeError
This commit addresses two potential issues related to issue #50:

1.  Enhanced `OSError` Logging in `utils.py`:
    The `printResponse` function in `src-python/utils.py` has been modified
    to include more robust error handling around the `json.dumps()` call.
    If an `OSError` (such as `[Errno 22] Invalid argument`) occurs during
    JSON serialization, the function will now:
    - Log the full traceback of the OSError.
    - Log the specific problematic response dictionary that caused the error.
    - Print a fallback JSON error message to stdout.
    This change aims to help diagnose the root cause of the `OSError`
    reported by you by capturing the exact data that triggers it.

2.  Prevent `AttributeError` for `.close()` calls:
    Added checks in `src-python/models/osc/osc.py` and
    `src-python/models/websocket/websocket_server.py` to ensure that
    objects are not `None` before their `.close()` or `.cancel()` methods
    are called. This specifically addresses:
    - `self.browser.zc.close()` and `self.browser.browser.cancel()` in `osc.py`.
    - `self._loop.close()` in `websocket_server.py`.
    These changes prevent potential `AttributeError: 'NoneType' object
    has no attribute 'close'` errors if these objects are not fully
    initialized before cleanup.
2025-06-18 14:47:17 +00:00
misyaguziya
c12f51f802 [bugfix] remove print root path 2025-06-16 18:59:37 +09:00
misyaguziya
e25cd62891 [Refactor] Improve overlay image creation logic for small logs and translations 2025-06-16 11:29:54 +09:00
misyaguziya
ab5c6b7bb5 [Refactor] Improve overlay image creation logic for large logs and translations 2025-06-16 06:45:13 +09:00
misyaguziya
acae7644eb [bugfix] ttfファイルのバスを修正 2025-06-15 15:54:41 +09:00
misyaguziya
dfc90508d1 [Fix] Controller: Handle VRAM overflow errors during translation and transcription processes. 2025-06-02 15:07:33 +09:00