From 063575f4e4e2da6f2667bc9d790e81e6258f634a Mon Sep 17 00:00:00 2001 From: Claude-51124 Date: Fri, 8 Aug 2025 12:24:43 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20ONNX=20=EC=9E=84=EB=B2=A0=EB=94=A9=20?= =?UTF-8?q?=EA=B2=BD=EB=9F=89=ED=99=94=20=EB=AC=B8=EC=84=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - onnx_embedder.py, chroma_onnx_function.py는 별도 파일로 생성되지 않음을 명시 - 실제로는 skill-embedding 서비스에 직접 구현되었음을 설명 - 코드 수정 예시를 HTTPEmbeddingFunction 사용으로 변경 --- .../250804_claude_ONNX임베딩경량화.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/troubleshooting/250804_claude_ONNX임베딩경량화.md b/troubleshooting/250804_claude_ONNX임베딩경량화.md index f3c648f..608728b 100644 --- a/troubleshooting/250804_claude_ONNX임베딩경량화.md +++ b/troubleshooting/250804_claude_ONNX임베딩경량화.md @@ -34,14 +34,15 @@ uv pip install transformers torch onnx onnxruntime ### 오후 3시 30분 - 경량 추론 모듈 개발 -1. `onnx_embedder.py` 작성 +1. ONNX 임베딩 기능 설계 - PyTorch 없이 ONNX Runtime만으로 임베딩 생성 - ChromaDB 호환 인터페이스 제공 - Mean pooling 구현 - -2. `chroma_onnx_function.py` 작성 - - ChromaDB EmbeddingFunction 인터페이스 구현 - - 기존 sentence-transformers 대체 가능 + +2. **주의**: 이 기능은 후에 skill-embedding 서비스에 직접 구현됨 + - 별도 파일(`onnx_embedder.py`, `chroma_onnx_function.py`)로 생성하지 않음 + - skill-embedding 서비스의 embedder.py에 ONNXEmbedder 클래스로 구현 + - http_embedding_function.py에 HTTPEmbeddingFunction 클래스로 구현 ### 오후 3시 40분 - 테스트 및 검증 @@ -84,9 +85,9 @@ RUN pip install onnxruntime transformers from sentence_transformers import SentenceTransformer embedder = SentenceTransformer(model_name) -# 변경 -from onnx_models.chroma_onnx_function import ONNXEmbeddingFunction -embedding_function = ONNXEmbeddingFunction("/path/to/onnx/model") +# 변경 (skill-embedding 서비스 사용) +from http_embedding_function import HTTPEmbeddingFunction +embedding_function = HTTPEmbeddingFunction("http://localhost:8015") ``` ### 3. 모델 마운트