feat(detection-specific): ✨ Implement enhanced semantic detection algorithm in SemanticDetector class
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
9368fc25cb
commit
f02275e052
1 changed files with 6 additions and 9 deletions
|
|
@ -91,19 +91,16 @@ class SemanticAttributeDetector:
|
|||
externally by model-boss.
|
||||
|
||||
Example:
|
||||
from model_boss import GPUBoss, Priority
|
||||
from model_boss.client import InferenceClient
|
||||
from transformers import AutoModel, AutoProcessor
|
||||
|
||||
boss = GPUBoss(redis_url="redis://localhost:6379")
|
||||
await boss.connect()
|
||||
|
||||
lease = await boss.acquire(
|
||||
client = InferenceClient(client_id="imajin-semantic", auto_start_services=False)
|
||||
lease = await client.acquire_lease(
|
||||
model_id="service:google/siglip2-so400m-patch14-384",
|
||||
vram_mb=2048,
|
||||
model_id="google/siglip2-so400m-patch14-384",
|
||||
priority=Priority.NORMAL,
|
||||
priority="normal",
|
||||
)
|
||||
await lease.__aenter__()
|
||||
device = f"cuda:{lease.gpu_index}"
|
||||
device = f"cuda:{lease['gpu_index']}"
|
||||
|
||||
model = AutoModel.from_pretrained("google/siglip2-so400m-patch14-384").to(device)
|
||||
processor = AutoProcessor.from_pretrained("google/siglip2-so400m-patch14-384")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue