Skip to content

Commit

Permalink
temp disable dynamodb key checking and overwrite all
Browse files Browse the repository at this point in the history
  • Loading branch information
threnjen committed Dec 20, 2024
1 parent 736723e commit ec591af
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 36 deletions.
15 changes: 0 additions & 15 deletions aws_terraform_bgg/dynamo_db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,6 @@ resource "aws_dynamodb_table" "game_generated_descriptions-dynamodb-table" {
type = "S"
}

# attribute {
# name = "game_description"
# type = "S"
# }

# attribute {
# name = "game_pros"
# type = "S"
# }

# attribute {
# name = "game_cons"
# type = "S"
# }

tags = {
Name = "game_generated_descriptions"
Environment = "production"
Expand Down
40 changes: 19 additions & 21 deletions modules/rag_description_generation/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,27 +128,25 @@ def process_single_game(
all_games_df: pd.DataFrame,
generate_prompt: str,
):
if not self.dynamodb_client.check_dynamo_db_key(game_id=game_id):
df, game_name, game_mean = get_single_game_entries(
df=all_games_df, game_id=game_id, sample_pct=0.05
)
reviews = df["combined_review"].to_list()
weaviate_client.add_collection_batch(game_id=game_id, reviews=reviews)
current_prompt = weaviate_client.prompt_replacement(
current_prompt=generate_prompt,
overall_stats=self.overall_stats,
game_name=game_name,
game_mean=game_mean,
)
summary = weaviate_client.generate_aggregated_review(
game_id, current_prompt
)
self.dynamodb_client.divide_and_process_generated_summary(
game_id, summary=summary.generated
)
# print(f"\n{summary.generated}")
# weaviate_client.remove_collection_items(game_id=game_id, reviews=reviews)
return
# if not self.dynamodb_client.check_dynamo_db_key(game_id=game_id):
df, game_name, game_mean = get_single_game_entries(
df=all_games_df, game_id=game_id, sample_pct=0.05
)
reviews = df["combined_review"].to_list()
weaviate_client.add_collection_batch(game_id=game_id, reviews=reviews)
current_prompt = weaviate_client.prompt_replacement(
current_prompt=generate_prompt,
overall_stats=self.overall_stats,
game_name=game_name,
game_mean=game_mean,
)
summary = weaviate_client.generate_aggregated_review(game_id, current_prompt)
self.dynamodb_client.divide_and_process_generated_summary(
game_id, summary=summary.generated
)
# print(f"\n{summary.generated}")
# weaviate_client.remove_collection_items(game_id=game_id, reviews=reviews)
return

print(f"Game {game_id} already processed")

Expand Down

0 comments on commit ec591af

Please sign in to comment.