Skip to content
Snippets Groups Projects
Unverified Commit 04b9f276 authored by Gal Dayan's avatar Gal Dayan Committed by GitHub
Browse files

Merge branch 'aurelio-labs:main' into main

parents f437eeae 82fadb57
No related branches found
No related tags found
No related merge requests found
[![Aurelio AI](https://pbs.twimg.com/profile_banners/1671498317455581184/1696285195/1500x500)](https://aurelio.ai) [![Semantic Router](https://i.ibb.co.com/g423grt/semantic-router-banner.png)](https://aurelio.ai)
# Semantic Router
<p> <p>
<img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/semantic-router?logo=python&logoColor=gold" /> <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/semantic-router?logo=python&logoColor=gold" />
...@@ -144,6 +142,8 @@ Our utterance vector space also integrates with [Pinecone](https://github.com/au ...@@ -144,6 +142,8 @@ Our utterance vector space also integrates with [Pinecone](https://github.com/au
### Community ### Community
Dimitrios Manias, Ali Chouman, Abdallah Shami, [Semantic Routing for Enhanced Performance of LLM-Assisted Intent-Based 5G Core Network Management and Orchestration](https://arxiv.org/abs/2404.15869), IEEE GlobeCom 2024
Julian Horsey, [Semantic Router superfast decision layer for LLMs and AI agents](https://www.geeky-gadgets.com/semantic-router-superfast-decision-layer-for-llms-and-ai-agents/), Geeky Gadgets Julian Horsey, [Semantic Router superfast decision layer for LLMs and AI agents](https://www.geeky-gadgets.com/semantic-router-superfast-decision-layer-for-llms-and-ai-agents/), Geeky Gadgets
azhar, [Beyond Basic Chatbots: How Semantic Router is Changing the Game](https://medium.com/ai-insights-cobet/beyond-basic-chatbots-how-semantic-router-is-changing-the-game-783dd959a32d), AI Insights @ Medium azhar, [Beyond Basic Chatbots: How Semantic Router is Changing the Game](https://medium.com/ai-insights-cobet/beyond-basic-chatbots-how-semantic-router-is-changing-the-game-783dd959a32d), AI Insights @ Medium
......
This diff is collapsed.
[tool.poetry] [tool.poetry]
name = "semantic-router" name = "semantic-router"
version = "0.0.44" version = "0.0.45"
description = "Super fast semantic router for AI decision making" description = "Super fast semantic router for AI decision making"
authors = [ authors = [
"James Briggs <james@aurelio.ai>", "James Briggs <james@aurelio.ai>",
...@@ -25,9 +25,9 @@ numpy = "^1.25.2" ...@@ -25,9 +25,9 @@ numpy = "^1.25.2"
colorlog = "^6.8.0" colorlog = "^6.8.0"
pyyaml = "^6.0.1" pyyaml = "^6.0.1"
pinecone-text = {version = ">=0.7.1,<0.8.0", optional = true} pinecone-text = {version = ">=0.7.1,<0.8.0", optional = true}
fastembed = {version = "^0.2.4", optional = true, python = "<3.12"}
torch = {version = ">=2.1.0,<2.6.0", optional = true} torch = {version = ">=2.1.0,<2.6.0", optional = true}
transformers = {version = "^4.36.2", optional = true} transformers = {version = ">=4.36.2", optional = true}
tokenizers = {version = ">=0.19", optional = true}
llama-cpp-python = {version = "^0.2.28", optional = true} llama-cpp-python = {version = "^0.2.28", optional = true}
colorama = "^0.4.6" colorama = "^0.4.6"
pinecone-client = {version=">=3.0.0,<4.0.0", optional = true} pinecone-client = {version=">=3.0.0,<4.0.0", optional = true}
...@@ -43,8 +43,7 @@ boto3 = { version = "^1.34.98", optional = true } ...@@ -43,8 +43,7 @@ boto3 = { version = "^1.34.98", optional = true }
[tool.poetry.extras] [tool.poetry.extras]
hybrid = ["pinecone-text"] hybrid = ["pinecone-text"]
fastembed = ["fastembed"] local = ["torch", "transformers", "tokenizers", "huggingface-hub", "llama-cpp-python"]
local = ["torch", "transformers", "llama-cpp-python"]
pinecone = ["pinecone-client"] pinecone = ["pinecone-client"]
vision = ["torch", "torchvision", "transformers", "pillow"] vision = ["torch", "torchvision", "transformers", "pillow"]
processing = ["matplotlib"] processing = ["matplotlib"]
......
...@@ -4,4 +4,4 @@ from semantic_router.route import Route ...@@ -4,4 +4,4 @@ from semantic_router.route import Route
__all__ = ["RouteLayer", "HybridRouteLayer", "Route", "LayerConfig"] __all__ = ["RouteLayer", "HybridRouteLayer", "Route", "LayerConfig"]
__version__ = "0.0.44" __version__ = "0.0.45"
...@@ -94,7 +94,9 @@ class AzureOpenAIEncoder(BaseEncoder): ...@@ -94,7 +94,9 @@ class AzureOpenAIEncoder(BaseEncoder):
for j in range(3): for j in range(3):
try: try:
embeds = self.client.embeddings.create( embeds = self.client.embeddings.create(
input=docs, model=str(self.model), dimensions=self.dimensions, input=docs,
model=str(self.model),
dimensions=self.dimensions,
) )
if embeds.data: if embeds.data:
break break
......
...@@ -5,7 +5,7 @@ from PIL import Image ...@@ -5,7 +5,7 @@ from PIL import Image
from semantic_router.encoders import CLIPEncoder from semantic_router.encoders import CLIPEncoder
test_model_name = "hf-internal-testing/tiny-random-CLIPModel" test_model_name = "aurelio-ai/sr-test-clip"
clip_encoder = CLIPEncoder(name=test_model_name) clip_encoder = CLIPEncoder(name=test_model_name)
embed_dim = 64 embed_dim = 64
......
...@@ -3,8 +3,10 @@ from semantic_router.encoders import FastEmbedEncoder ...@@ -3,8 +3,10 @@ from semantic_router.encoders import FastEmbedEncoder
class TestFastEmbedEncoder: class TestFastEmbedEncoder:
def test_fastembed_encoder(self): def test_fastembed_encoder(self):
encode = FastEmbedEncoder() if False:
test_docs = ["This is a test", "This is another test"] # temporarily disabled until fastembed added back as dep
encode = FastEmbedEncoder()
test_docs = ["This is a test", "This is another test"]
embeddings = encode(test_docs) embeddings = encode(test_docs)
assert isinstance(embeddings, list) assert isinstance(embeddings, list)
...@@ -5,7 +5,7 @@ import pytest ...@@ -5,7 +5,7 @@ import pytest
from semantic_router.encoders.huggingface import HuggingFaceEncoder from semantic_router.encoders.huggingface import HuggingFaceEncoder
test_model_name = "hf-internal-testing/tiny-bert" test_model_name = "aurelio-ai/sr-test-huggingface"
encoder = HuggingFaceEncoder(name=test_model_name) encoder = HuggingFaceEncoder(name=test_model_name)
......
...@@ -5,7 +5,7 @@ from PIL import Image ...@@ -5,7 +5,7 @@ from PIL import Image
from semantic_router.encoders import VitEncoder from semantic_router.encoders import VitEncoder
test_model_name = "hf-internal-testing/tiny-random-vit" test_model_name = "aurelio-ai/sr-test-vit"
vit_encoder = VitEncoder(name=test_model_name) vit_encoder = VitEncoder(name=test_model_name)
embed_dim = 32 embed_dim = 32
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment