Skip to content

Commit

Permalink
rerun benchmark with fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CShorten committed Feb 21, 2025
1 parent 7787957 commit fd2a776
Show file tree
Hide file tree
Showing 9 changed files with 140,293 additions and 39 deletions.
2 changes: 1 addition & 1 deletion src/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
DEFAULT_VECTORIZER_MODULE: 'text2vec-openai'
OPENAI_API_KEY: ''
OPENAI_API_KEY: 'YOUR_OPENAI_API_KEY'
ENABLE_MODULES: 'text2vec-openai'
ENABLE_API_BASED_MODULES: 'true'
CLUSTER_HOSTNAME: 'node1'
Expand Down
7 changes: 7 additions & 0 deletions src/lm/lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

# google models are accessed through the openai SDK with a check on `model_name`
# together models are accessed through the openai SDK with a different base URL
# grok models are accessed through the openai SDK with a different base URL
LMModelProvider = Literal["ollama", "openai", "anthropic", "cohere", "together"]

# need to add models to this...!
Expand All @@ -45,6 +46,12 @@ def __init__(
api_key=api_key,
base_url="https://generativelanguage.googleapis.com/v1beta/"
)
elif self.model_name.startswith("grok-"):
print("\033[96mUsing Grok through the OpenAI SDK.\033[0m")
self.lm_client = openai.OpenAI(
api_key=api_key,
base_url="https://api.x.ai/v1"
)
else:
self.lm_client = openai.OpenAI(
api_key=api_key
Expand Down
15 changes: 1 addition & 14 deletions src/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,6 @@ class SyntheticFilterQueries(BaseModel):
boolean_property_filter_query: BooleanPropertyFilterWithQuery

class WeaviateQuery(BaseModel):
corresponding_natural_language_query: str
target_collection: str
search_query: Optional[str]
integer_property_filter: Optional[IntPropertyFilter]
text_property_filter: Optional[TextPropertyFilter]
boolean_property_filter: Optional[BooleanPropertyFilter]
integer_property_aggregation: Optional[IntAggregation]
text_property_aggregation: Optional[TextAggregation]
boolean_property_aggregation: Optional[BooleanAggregation]
groupby_property: Optional[str]

class NewWeaviateQuery(BaseModel):
corresponding_natural_language_query: Optional[str] = None
target_collection: str
search_query: Optional[str] = None
Expand Down Expand Up @@ -371,5 +359,4 @@ class TogetherAIFunction(BaseModel):

class TogetherAITool(BaseModel):
type: Literal["function"]
function: TogetherAIFunction

function: TogetherAIFunction
2 changes: 1 addition & 1 deletion src/optimizers/setup_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Connect to Weaviate and populate datasets
client = weaviate.connect_to_local(
headers={
"X-OpenAI-Api-Key": ""
"X-OpenAI-Api-Key": os.getenv("OPENAI_API_KEY")
}
)
WEAVIATE_URL = "http://localhost:8080/v1/schema"
Expand Down
Loading

0 comments on commit fd2a776

Please sign in to comment.