cocoindex-code 0.1.11__tar.gz → 0.1.12__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cocoindex-code
3
- Version: 0.1.11
3
+ Version: 0.1.12
4
4
  Summary: MCP server for indexing and querying codebases using CocoIndex
5
5
  Project-URL: Homepage, https://github.com/cocoindex-io/cocoindex-code
6
6
  Project-URL: Repository, https://github.com/cocoindex-io/cocoindex-code
@@ -9,19 +9,6 @@ from pathlib import Path
9
9
  _DEFAULT_MODEL = "sbert/sentence-transformers/all-MiniLM-L6-v2"
10
10
 
11
11
 
12
- def _detect_device() -> str:
13
- """Return best available compute device, respecting env var override."""
14
- override = os.environ.get("COCOINDEX_CODE_DEVICE")
15
- if override:
16
- return override
17
- try:
18
- import torch
19
-
20
- return "cuda" if torch.cuda.is_available() else "cpu"
21
- except (ImportError, ModuleNotFoundError):
22
- return "cpu"
23
-
24
-
25
12
  def _find_root_with_marker(start: Path, markers: list[str]) -> Path | None:
26
13
  """Walk up from start, return first directory containing any marker."""
27
14
  current = start
@@ -62,7 +49,7 @@ class Config:
62
49
  codebase_root_path: Path
63
50
  embedding_model: str
64
51
  index_dir: Path
65
- device: str
52
+ device: str | None
66
53
  trust_remote_code: bool
67
54
  extra_extensions: dict[str, str | None]
68
55
 
@@ -87,7 +74,7 @@ class Config:
87
74
  index_dir = root / ".cocoindex_code"
88
75
 
89
76
  # Device: auto-detect CUDA or use env override
90
- device = _detect_device()
77
+ device = os.environ.get("COCOINDEX_CODE_DEVICE")
91
78
 
92
79
  # trust_remote_code: opt-in via env var only.
93
80
  # sentence-transformers 5.x+ supports Jina models natively, so
File without changes