add numpy to requirements

pull/861/head
Kye Gomez 6 days ago
parent 1484be7d39
commit 7c9dd585bd

@ -24,4 +24,5 @@ aiofiles
httpx httpx
# vllm>=0.2.0 # vllm>=0.2.0
aiohttp aiohttp
mcp mcp
numpy

@ -1,7 +1,6 @@
import json import json
from typing import List, Optional, Tuple from typing import List, Optional, Tuple
import numpy as np
from pydantic import BaseModel, Field from pydantic import BaseModel, Field
from tenacity import retry, stop_after_attempt, wait_exponential from tenacity import retry, stop_after_attempt, wait_exponential
@ -80,7 +79,7 @@ class SwarmMatcher:
stop=stop_after_attempt(3), stop=stop_after_attempt(3),
wait=wait_exponential(multiplier=1, min=4, max=10), wait=wait_exponential(multiplier=1, min=4, max=10),
) )
def get_embedding(self, text: str) -> np.ndarray: def get_embedding(self, text: str):
""" """
Generates an embedding for a given text using the configured model. Generates an embedding for a given text using the configured model.
@ -90,6 +89,7 @@ class SwarmMatcher:
Returns: Returns:
np.ndarray: The embedding vector for the text. np.ndarray: The embedding vector for the text.
""" """
import numpy as np
logger.debug(f"Getting embedding for text: {text[:50]}...") logger.debug(f"Getting embedding for text: {text[:50]}...")
try: try:
inputs = self.tokenizer( inputs = self.tokenizer(
@ -141,6 +141,7 @@ class SwarmMatcher:
Returns: Returns:
Tuple[str, float]: A tuple containing the name of the best matching swarm type and the score. Tuple[str, float]: A tuple containing the name of the best matching swarm type and the score.
""" """
import numpy as np
logger.debug(f"Finding best match for task: {task[:50]}...") logger.debug(f"Finding best match for task: {task[:50]}...")
try: try:
task_embedding = self.get_embedding(task) task_embedding = self.get_embedding(task)

Loading…
Cancel
Save