Skip to content

Commit

Permalink
hello 1
Browse files Browse the repository at this point in the history
hello 2
hello 3

hello 4
  • Loading branch information
ydshieh committed Apr 29, 2024
1 parent d6e98f3 commit c482554
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/self-new-model-pr-caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
# TODO: get this value from the commit message
- name: Check if there are specified models
run: |
echo "models=['models/bert', 'models/gpt2']" >> $GITHUB_ENV
echo "models=$(python utils/check_if_new_model_added.py | tail -n 1)" >> $GITHUB_ENV
# TODO: combine the values
Expand All @@ -64,6 +63,16 @@ jobs:
run: |
echo "${{ needs.find_models_to_run.outputs.models }}"
dummy2:
runs-on: ubuntu-22.04
name: Check specified models to test 3333444444
needs: find_models_to_run
if: contains(fromJson(needs.find_models_to_run.outputs.matrix), 'dummy') != true
steps:
- name: Check if there are specified models
run: |
echo "${{ needs.find_models_to_run.outputs.models }}"
#
# run_models_gpu:
# name: Run all tests for the new model
Expand Down
18 changes: 16 additions & 2 deletions utils/check_if_new_model_added.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def get_new_python_files() -> List[str]:
return get_new_python_files_between_commits(repo.head.commit, branching_commits)


if __name__ == "__main__":
def get_new_model():
new_files = get_new_python_files()
reg = re.compile(r"src/transformers/(models/.*)/modeling_.*\.py")

Expand All @@ -93,4 +93,18 @@ def get_new_python_files() -> List[str]:
new_model = find_new_model[0]
# It's unlikely we have 2 new modeling files in a pull request.
break
print(new_model)
return new_model


def get_models_from_commit_message(commit_message):
return ["models/bert", "models/gpt2"]


if __name__ == "__main__":

new_model = get_new_model()
specified_models = get_models_from_commit_message("")
models = ([] if new_model == "" else [new_model]) + specified_models
if len(models) == 0:
models = ["dummy"]
print(models)

0 comments on commit c482554

Please sign in to comment.