初始化项目,由ModelHub XC社区提供模型
Model: nv-community/Nemotron-Cascade-8B Source: Original Platform
This commit is contained in:
9
evaluation/eval/tools/latex2sympy/scripts/compile.sh
Normal file
9
evaluation/eval/tools/latex2sympy/scripts/compile.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Get relative path of the root directory of the project
|
||||
rdir=`git rev-parse --git-dir`
|
||||
rel_path="$(dirname "$rdir")"
|
||||
# Change to that path and run the file
|
||||
cd $rel_path
|
||||
|
||||
java -jar antlr-4.11.1-complete.jar PS.g4 -o gen
|
||||
3
evaluation/eval/tools/latex2sympy/scripts/coverage-ci.sh
Normal file
3
evaluation/eval/tools/latex2sympy/scripts/coverage-ci.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
pytest --doctest-modules --junitxml=junit/test-results.xml --cov-report=xml --cov-config=.coveragerc --cov=latex2sympy tests
|
||||
23
evaluation/eval/tools/latex2sympy/scripts/coverage.sh
Normal file
23
evaluation/eval/tools/latex2sympy/scripts/coverage.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Get relative path of the root directory of the project
|
||||
rdir=`git rev-parse --git-dir`
|
||||
rel_path="$(dirname "$rdir")"
|
||||
# Change to that path and run the file
|
||||
cd $rel_path
|
||||
|
||||
# Activate virtual environment
|
||||
echo "activating venv..."
|
||||
if test -f .env/bin/activate
|
||||
then source .env/bin/activate && echo "venv activate (bin)"
|
||||
elif test -f .env/Scripts/activate
|
||||
then source .env/Scripts/activate && echo "venv activated (Scripts)"
|
||||
else exit 1
|
||||
fi
|
||||
|
||||
# Run unit test coverage
|
||||
echo "starting coverage..."
|
||||
if pytest --doctest-modules --cov-report=html --cov-config=.coveragerc --cov=latex2sympy tests
|
||||
then echo "coverage finished"
|
||||
else exit 1
|
||||
fi
|
||||
28
evaluation/eval/tools/latex2sympy/scripts/pre-commit
Normal file
28
evaluation/eval/tools/latex2sympy/scripts/pre-commit
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Get relative path of the root directory of the project
|
||||
rdir=`git rev-parse --git-dir`
|
||||
rel_path="$(dirname "$rdir")"
|
||||
|
||||
# Change to that path and run the file
|
||||
cd $rel_path
|
||||
|
||||
echo "pre-commit hook started..."
|
||||
|
||||
# Activate virtual environment
|
||||
echo "activating venv..."
|
||||
if test -f .env/bin/activate
|
||||
then source .env/bin/activate && echo "venv activated."
|
||||
elif test -f .env/Scripts/activate
|
||||
then source .env/Scripts/activate && echo "venv activated."
|
||||
else exit 1
|
||||
fi
|
||||
|
||||
# Run auto formatting on all staged python files, then add those changes
|
||||
echo "auto-formatting code..."
|
||||
if autopep8 --in-place `git diff --name-status --cached | grep '.py' | awk 'match($1, "A|M"){print $2}'` && git add `git diff --name-status --cached | grep '.py' | awk 'match($1, "A|M"){print $2}'`
|
||||
then echo "code was auto-formatted."
|
||||
else echo "no code was auto-formatted."
|
||||
fi
|
||||
|
||||
exit 0
|
||||
28
evaluation/eval/tools/latex2sympy/scripts/pre-push
Normal file
28
evaluation/eval/tools/latex2sympy/scripts/pre-push
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Get relative path of the root directory of the project
|
||||
rdir=`git rev-parse --git-dir`
|
||||
rel_path="$(dirname "$rdir")"
|
||||
|
||||
# Change to that path and run the file
|
||||
cd $rel_path
|
||||
|
||||
echo "pre-push hook started..."
|
||||
|
||||
# Activate virtual environment
|
||||
echo "activating venv..."
|
||||
if test -f .env/bin/activate
|
||||
then source .env/bin/activate && echo "venv activated."
|
||||
elif test -f .env/Scripts/activate
|
||||
then source .env/Scripts/activate && echo "venv activated."
|
||||
else exit 1
|
||||
fi
|
||||
|
||||
# Run unit tests
|
||||
echo "starting tests..."
|
||||
# if pytest tests
|
||||
# then echo "tests finished."
|
||||
# else exit 1
|
||||
# fi
|
||||
|
||||
exit 0
|
||||
3
evaluation/eval/tools/latex2sympy/scripts/publish.sh
Normal file
3
evaluation/eval/tools/latex2sympy/scripts/publish.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
rm ./dist/*
|
||||
python3 setup.py bdist_wheel
|
||||
twine upload dist/*
|
||||
3
evaluation/eval/tools/latex2sympy/scripts/setup-hooks.sh
Normal file
3
evaluation/eval/tools/latex2sympy/scripts/setup-hooks.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
cp scripts/pre-push .git/hooks/
|
||||
cp scripts/pre-commit .git/hooks/
|
||||
42
evaluation/eval/tools/latex2sympy/scripts/setup.sh
Normal file
42
evaluation/eval/tools/latex2sympy/scripts/setup.sh
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Get relative path of the root directory of the project
|
||||
rdir=`git rev-parse --git-dir`
|
||||
rel_path="$(dirname "$rdir")"
|
||||
# Change to that path and run the file
|
||||
cd $rel_path
|
||||
|
||||
echo "creating venv..."
|
||||
if test -d .env
|
||||
then echo "venv exists"
|
||||
else python3 -m venv .env && echo "venv created"
|
||||
fi
|
||||
|
||||
echo ''
|
||||
# Activate virtual environment
|
||||
echo "activating venv..."
|
||||
if test -f .env/bin/activate
|
||||
then source .env/bin/activate && echo "venv activate (bin)"
|
||||
elif test -f .env/Scripts/activate
|
||||
then source .env/Scripts/activate && echo "venv activated (Scripts)"
|
||||
else exit 1
|
||||
fi
|
||||
|
||||
echo ''
|
||||
echo "installing requirements..."
|
||||
if pip install -r dev-requirements.txt
|
||||
then echo "requirements installed"
|
||||
else exit 1
|
||||
fi
|
||||
|
||||
echo ''
|
||||
echo "compiling parser..."
|
||||
sh scripts/compile.sh
|
||||
echo "parser compiled"
|
||||
|
||||
echo ''
|
||||
echo "setup git hooks..."
|
||||
sh scripts/setup-hooks.sh
|
||||
echo "git hooks setup"
|
||||
|
||||
exit 0
|
||||
31
evaluation/eval/tools/latex2sympy/scripts/test.sh
Normal file
31
evaluation/eval/tools/latex2sympy/scripts/test.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Get relative path of the root directory of the project
|
||||
rdir=`git rev-parse --git-dir`
|
||||
rel_path="$(dirname "$rdir")"
|
||||
# Change to that path and run the file
|
||||
cd $rel_path
|
||||
|
||||
# Activate virtual environment
|
||||
echo "activating venv..."
|
||||
if test -f .env/bin/activate
|
||||
then source .env/bin/activate && echo "venv activate (bin)"
|
||||
elif test -f .env/Scripts/activate
|
||||
then source .env/Scripts/activate && echo "venv activated (Scripts)"
|
||||
else exit 1
|
||||
fi
|
||||
|
||||
echo ''
|
||||
echo "compiling parser..."
|
||||
sh scripts/compile.sh
|
||||
echo "parser compiled"
|
||||
|
||||
echo ''
|
||||
# Run unit tests
|
||||
echo "starting tests..."
|
||||
if pytest tests
|
||||
then echo "tests finished"
|
||||
else exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user