Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark and deploy mech tools #167

Closed
wants to merge 13 commits into from

Conversation

evangriffiths
Copy link
Contributor

@evangriffiths evangriffiths commented Feb 14, 2024

Add PMAT dependency and add scripts for benchmarking and deploying mech tools

@evangriffiths evangriffiths changed the title Add PMAT dependency and add scripts for benchmarking and deploying mech tools Benchmar and deploy mech tools Feb 14, 2024
@evangriffiths evangriffiths changed the title Benchmar and deploy mech tools Benchmark and deploy mech tools Feb 14, 2024
@@ -1138,7 +1139,7 @@ def run(**kwargs) -> Tuple[str, Optional[str], Optional[Dict[str, Any]], Any]:
engine = TOOL_TO_ENGINE[tool]

# Extract the event question from the prompt
event_question = re.search(r"\"(.+?)\"", prompt).group(1)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regex search often returns None, causing exception

@@ -303,7 +304,6 @@ def fetch_additional_information(
json_data["queries"],
api_key=google_api_key,
engine=google_engine,
num_urls=num_urls,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bugfix

@@ -60,7 +60,8 @@ def count_tokens(text: str, model: str) -> int:


NUM_URLS_EXTRACT = 5
DEFAULT_NUM_WORDS: Dict[str, Optional[int]] = defaultdict(lambda: 300)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bugfix

@@ -202,7 +203,7 @@ def get_urls_from_queries(queries: List[str], api_key: str, engine: str) -> List
query=query,
api_key=api_key,
engine=engine,
num=3, # Number of returned results
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 or NUM_URLS_EXTRACT==5? Hmm, let's use global var

@evangriffiths
Copy link
Contributor Author

Oops, base branch was meant to be my fork!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant