Skip to content

Commit

Permalink
chore: publish hf hub only at release
Browse files Browse the repository at this point in the history
  • Loading branch information
k4black committed Jul 12, 2023
1 parent 1f1a86a commit 89ae3db
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 27 deletions.
1 change: 0 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,3 @@ jobs:
git commit --allow-empty -m "Auto files update [${{ github.ref_name }}]"
ls -lah
git push https://k4black:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/k4black/codebleu main
20 changes: 0 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,3 @@ jobs:
flags: unittests # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

sync-to-hf-hub:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download hf repo
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git clone https://k4black:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/k4black/codebleu hf_evaluate_codebleu
cd hf_evaluate_codebleu
git checkout main
- name: Update files and push
run: |
cp -r evaluate_app/* hf_evaluate_codebleu
cd hf_evaluate_codebleu
git add .
git commit --allow-empty -m "Auto files update [${{ github.ref_name }}]"
ls -lah
git push https://k4black:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/k4black/codebleu main
8 changes: 3 additions & 5 deletions evaluate_app/codebleu.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
"""

_DESCRIPTION = """\
Unofficial `CodeBLEU` implementation with Linux and MacOS supports available with PyPI and HF HUB.
Based on original [CodeXGLUE/CodeBLEU](https://github.com/microsoft/CodeXGLUE/tree/main/Code-Code/code-to-code-trans/evaluator/CodeBLEU) code -- refactored, build for macos, tested and fixed multiple crutches to make it more usable.
Unofficial `CodeBLEU` implementation that supports Linux and MacOS.
"""


Expand Down Expand Up @@ -79,7 +77,7 @@ def _info(self):
{
"predictions": datasets.Value("string", id="sequence"),
"references": datasets.Sequence(datasets.Value("string", id="sequence"), id="references"),
# "lang": datasets.Value("string"),
"lang": datasets.Value("string"),
# "weights": datasets.Value("string"),
# "tokenizer": datasets.Value("string"),
}
Expand All @@ -88,7 +86,7 @@ def _info(self):
{
"predictions": datasets.Value("string", id="sequence"),
"references": datasets.Value("string", id="sequence"),
# "lang": datasets.Value("string"),
"lang": datasets.Value("string"),
# "weights": datasets.Value("string"),
# "tokenizer": datasets.Value("string"),
}
Expand Down
2 changes: 1 addition & 1 deletion evaluate_app/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
git+https://github.com/huggingface/evaluate@main
codebleu>=0.1.8,<1.0.0
codebleu>=0.2.0,<1.0.0

0 comments on commit 89ae3db

Please sign in to comment.