Skip to content

Commit

Permalink
Add SQL_EVAL_UPLOAD_URL env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rishsriv committed Feb 11, 2024
1 parent 279387b commit 85176a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ python main.py \
--upload_url <your cloud function url>
```

If you would like to always report your results to an upload_url, even if it's not explicitly provided, you can set it in your environment variables as `SQL_EVAL_UPLOAD_URL`
#### Testing the function locally
If you'd like to modify the functions and test it out locally, you can run these sample commands to deploy the function locally and then trigger the openai runner:
```bash
Expand Down
4 changes: 4 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import argparse
import os

if __name__ == "__main__":
parser = argparse.ArgumentParser()
Expand Down Expand Up @@ -36,6 +37,9 @@
f"WARNING: Check that questions_file {args.questions_file} is compatible with db_type {args.db_type}"
)

if args.upload_url is None:
args.upload_url = os.environ.get("SQL_EVAL_UPLOAD_URL")

# check that the list of prompt files has the same length as the list of output files
if len(args.prompt_file) != len(args.output_file):
raise ValueError(
Expand Down

0 comments on commit 85176a5

Please sign in to comment.