-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into doc/word_language_model
- Loading branch information
Showing
7 changed files
with
65 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Run Examples | ||
name: Run CPP Examples | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Run Examples | ||
name: Run Python Examples | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env bash | ||
# This script contains utility functions and initialize exmaple scripts. | ||
# Eg: run_python_examples.sh, run_distributed_examples.sh | ||
|
||
BASE_DIR="$(pwd)/$(dirname $0)" | ||
EXAMPLES=$(echo $1 | sed -e 's/ //g') | ||
|
||
# Redirect 'python' calls to 'python3' | ||
python() { | ||
command python3 "$@" | ||
} | ||
|
||
ERRORS=${ERRORS-""} | ||
|
||
function error() { | ||
ERR=$1 | ||
if [ "" == "$ERRORS" ]; then | ||
ERRORS="$ERR" | ||
else | ||
ERRORS="$ERRORS\n$ERR" | ||
fi | ||
} | ||
|
||
function install_deps() { | ||
echo "installing requirements" | ||
cat $BASE_DIR/*/requirements.txt | \ | ||
sort -u | \ | ||
# testing the installed version of torch, so don't pip install it. | ||
grep -vE '^torch$' | \ | ||
pip install -r /dev/stdin || \ | ||
{ error "failed to install dependencies"; exit 1; } | ||
} | ||
|
||
function start() { | ||
EXAMPLE=${FUNCNAME[1]} | ||
cd $BASE_DIR/$EXAMPLE | ||
echo "Running example: $EXAMPLE" | ||
} |