Skip to content

Commit

Permalink
fix python format
Browse files Browse the repository at this point in the history
  • Loading branch information
Qing Lan committed May 15, 2024
1 parent 7f15988 commit 988cb39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions tests/integration/instant_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,11 @@ def parse_raw_template(url, override_container):
mul_results = multiply_template_with_vars(name, cur_result, vars)
# each of the replicated deployment options
for r in mul_results.values():
replicated_awscurl = multiply_template_with_vars('', {'awscurl': cur_result['awscurl']}, benchmark_vars)
replicated_awscurl = multiply_template_with_vars(
'', {'awscurl': cur_result['awscurl']}, benchmark_vars)
for option in replicated_awscurl.keys():
replicated_awscurl[option] = replicated_awscurl[option]['awscurl'].encode().hex()
replicated_awscurl[option] = replicated_awscurl[option][
'awscurl'].encode().hex()
r['awscurl'] = replicated_awscurl
final_result.update(mul_results)
name = ''
Expand Down Expand Up @@ -242,16 +244,18 @@ def build_running_script(template, job, instance):
container = job_template['container']

benchmark_command = []
record_benchmark = ('python3 record_benchmark.py --template template.json '
'--job ${{ matrix.job }} --instance ${{ inputs.instance }} '
'--model models/test --record ${{ inputs.record }}')
record_benchmark = (
'python3 record_benchmark.py --template template.json '
'--job ${{ matrix.job }} --instance ${{ inputs.instance }} '
'--model models/test --record ${{ inputs.record }}')

for key, value in job_template['awscurl'].items():
benchmark_command.append(value)
benchmark_command.append(record_benchmark + f' --benchmark-vars {key}')

bash_command = [
'set -euo pipefail', 'echo "Start Launching container..."',
'set -euo pipefail',
'echo "Start Launching container..."',
f"docker pull {container}",
f"./launch_container.sh {container} $PWD/models {machine_translation(instance)}",
]
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/record_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
required=False,
type=str,
help="The benchmark variables used to differentiate in"
" cloudwatch like [CONCURRENCY=2,DATASET=gsm8k]")
" cloudwatch like [CONCURRENCY=2,DATASET=gsm8k]")
parser.add_argument("--info",
required=False,
type=str,
Expand Down

0 comments on commit 988cb39

Please sign in to comment.