Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
ayulockin committed May 13, 2024
1 parent a14d1d3 commit 9320a9c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
16 changes: 8 additions & 8 deletions src/wandbot/chat/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"""
from typing import List

from weave.monitoring import StreamTable
# from weave.monitoring import StreamTable

import wandb
from wandbot.chat.config import ChatConfig
Expand Down Expand Up @@ -66,11 +66,11 @@ def __init__(
job_type="chat",
)
self.run._label(repo="wandbot")
self.stream_table = StreamTable(
table_name="chat_logs",
project_name=self.config.wandb_project,
entity_name=self.config.wandb_entity,
)
# self.stream_table = StreamTable(
# table_name="chat_logs",
# project_name=self.config.wandb_project,
# entity_name=self.config.wandb_entity,
# )

self.rag_pipeline = RAGPipeline(vector_store=vector_store)

Expand Down Expand Up @@ -109,7 +109,7 @@ def __call__(self, chat_request: ChatRequest) -> ChatResponse:
}
result_dict.update({"application": chat_request.application})
self.run.log(usage_stats)
self.stream_table.log(result_dict)
# self.stream_table.log(result_dict)
return ChatResponse(**result_dict)
except Exception as e:
with Timer() as timer:
Expand All @@ -131,5 +131,5 @@ def __call__(self, chat_request: ChatRequest) -> ChatResponse:
"end_time": timer.stop,
}
)
self.stream_table.log(result)
# self.stream_table.log(result)
return ChatResponse(**result)
10 changes: 6 additions & 4 deletions src/wandbot/ingestion/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ def main():
project = os.environ.get("WANDB_PROJECT", "wandbot-dev")
entity = os.environ.get("WANDB_ENTITY", "wandbot")

raw_artifact = prepare_data.load(project, entity)
preprocessed_artifact = preprocess_data.load(project, entity, raw_artifact)
# raw_artifact = prepare_data.load(project, entity)
raw_artifact = "wandbot/wandbot-dev/raw_dataset:v56"
# preprocessed_artifact = preprocess_data.load(project, entity, raw_artifact)
preprocessed_artifact = "wandbot/wandbot-dev/transformed_data:v23"
vectorstore_artifact = vectorstores.load(
project, entity, preprocessed_artifact
project, entity, preprocessed_artifact, "chroma_index"
)

create_ingestion_report(project, entity, raw_artifact, vectorstore_artifact)
# create_ingestion_report(project, entity, raw_artifact, vectorstore_artifact)
print(vectorstore_artifact)


Expand Down
2 changes: 1 addition & 1 deletion src/wandbot/rag/query_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class QueryEnhancer:
def __init__(
self,
model: str = "gpt-4-0125-preview",
fallback_model: str = "gpt-4-1106-preview",
fallback_model: str = "gpt-4-0125-preview",
):
self.model = model # type: ignore
self.fallback_model = fallback_model # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion src/wandbot/rag/response_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class ResponseSynthesizer:
def __init__(
self,
model: str = "gpt-4-0125-preview",
fallback_model: str = "gpt-4-1106-preview",
fallback_model: str = "gpt-4-0125-preview",
):
self.model = model # type: ignore
self.fallback_model = fallback_model # type: ignore
Expand Down

0 comments on commit 9320a9c

Please sign in to comment.