Skip to content

Commit cb7bd39

Browse files
authored
Merge pull request #12 from metauto-ai/remove_specific_folders
remove specific folders
2 parents 743949a + 72636ca commit cb7bd39

File tree

5 files changed

+38
-17
lines changed

5 files changed

+38
-17
lines changed

agent_as_a_judge/module/ask.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,15 @@ def ask(self, question: str, evidence: str) -> str:
118118

119119
if __name__ == "__main__":
120120
load_dotenv()
121-
workspace_path = Path("/Users/zhugem/Desktop/DevAI/studio/workspace/sample/")
122-
judge_dir = Path(os.getenv("JUDGE_DIR", "./judge_workspace"))
121+
workspace_path = (
122+
Path(os.getenv("PROJECT_DIR"))
123+
/ "benchmark/workspace/OpenHands/39_Drug_Response_Prediction_SVM_GDSC_ML"
124+
)
125+
judge_dir = (
126+
Path(os.getenv("PROJECT_DIR"))
127+
+ "/benchmark/judgement/OpenHands/39_Drug_Response_Prediction_SVM_GDSC_ML"
128+
)
129+
judge_dir.mkdir(parents=True, exist_ok=True)
123130
dev_ask = DevAsk(workspace=workspace_path, judge_dir=judge_dir)
124131

125132
while True:

agent_as_a_judge/module/code_search.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
DevCodeSearch: A class for searching and displaying code snippets and their metadata.
33
"""
44

5+
import os
56
import io
67
import json
78
import pickle
@@ -10,6 +11,7 @@
1011
from typing import List, Dict, Any, Generator, Union
1112
import networkx as nx
1213
import spacy
14+
from dotenv import load_dotenv
1315
from pathlib import Path
1416
from rank_bm25 import BM25Okapi
1517
from sentence_transformers import SentenceTransformer, util
@@ -397,11 +399,18 @@ def add_branch(tree: Tree, structure: Dict[str, Any], current_depth: int):
397399

398400

399401
if __name__ == "__main__":
400-
judge_path = Path(
401-
"/Users/zhugem/Desktop/DevAI/benchmark/judgment/OpenHands/agent_as_a_judge/black_box/01_Image_Classification_ResNet18_Fashion_MNIST_DL"
402+
403+
load_dotenv()
404+
workspace_path = (
405+
Path(os.getenv("PROJECT_DIR"))
406+
/ "benchmark/workspace/OpenHands/39_Drug_Response_Prediction_SVM_GDSC_ML"
407+
)
408+
judge_dir = (
409+
Path(os.getenv("PROJECT_DIR"))
410+
+ "/benchmark/judgement/OpenHands/39_Drug_Response_Prediction_SVM_GDSC_ML"
402411
)
403-
judge_path.mkdir(parents=True, exist_ok=True)
404-
dev_search = DevCodeSearch(judge_path)
412+
judge_dir.mkdir(parents=True, exist_ok=True)
413+
dev_search = DevCodeSearch(judge_dir)
405414

406415
query = "The FashionMnist datset is loaded in `src/data_loader.py`."
407416
search_results = dev_search.embed_search(query)

agent_as_a_judge/module/graph.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -924,15 +924,17 @@ def list_filtered_py_files(self):
924924

925925
if __name__ == "__main__":
926926

927-
workspace_path = "/Users/zhugem/Desktop/DevAI/benchmark/workspaces/OpenHands/39_Drug_Response_Prediction_SVM_GDSC_ML/"
928927
load_dotenv()
929-
judge_dir = os.getenv("JUDGE_DIR")
930-
if judge_dir is None:
931-
raise ValueError("The JUDGE_DIR environment variable is not set")
928+
workspace_path = (
929+
Path(os.getenv("PROJECT_DIR"))
930+
/ "benchmark/workspace/OpenHands/39_Drug_Response_Prediction_SVM_GDSC_ML"
931+
)
932+
judge_path = (
933+
Path(os.getenv("PROJECT_DIR"))
934+
+ "/benchmark/judgement/OpenHands/39_Drug_Response_Prediction_SVM_GDSC_ML"
935+
)
936+
judge_path.mkdir(parents=True, exist_ok=True)
932937
sample_name = os.path.basename(os.path.normpath(workspace_path))
933-
judge_path = os.path.join(judge_dir, sample_name)
934-
if not os.path.exists(judge_path):
935-
os.makedirs(judge_path)
936938

937939
dev_graph = DevGraph(
938940
root=workspace_path,

agent_as_a_judge/module/text_retrieve.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,13 @@ def _generate_metadata(self, text_entry: Dict[str, Any]) -> Text:
299299

300300

301301
if __name__ == "__main__":
302-
import dotenv
302+
from dotenv import load_dotenv
303303

304-
dotenv.load_dotenv()
305-
306-
trajectory_file = "/Users/zhugem/Desktop/DevAI/benchmark/trajectories/OpenHands/19_Time_Series_Forecasting_Seq2Seq_LSTM_Rossmann_ML.json"
304+
load_dotenv()
305+
trajectory_file = (
306+
Path(os.getenv("PROJECT_DIR"))
307+
+ "/benchmark/trajectories/OpenHands/39_Drug_Response_Prediction_SVM_GDSC_ML.json"
308+
)
307309
dev_text_search = DevTextRetrieve(trajectory_file)
308310

309311
# Criteria for LLM summary

agent_as_a_judge/utils/truncate.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
load_dotenv()
88

9+
910
def truncate_string(
1011
info_string: Union[str, None],
1112
model: str = os.getenv("DEFAULT_LLM"),

0 commit comments

Comments
 (0)