-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Move to bash as that was implicitly expected (ref. #vidyut on Discord) - Some refactoring. - Sub-make is correctly called when using make create_all_data. - Use -j`nproc` in make. - Ignore venv in git.
- Loading branch information
1 parent
38f4dd7
commit f38da63
Showing
6 changed files
with
84 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
/data/ | ||
/dcs-data/ | ||
*.log | ||
**/www/env |
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 |
---|---|---|
@@ -1,54 +1,76 @@ | ||
#!/usr/bin/env sh | ||
#!/usr/bin/env bash | ||
|
||
# Create all of the linguistic data necessary for general usage. | ||
|
||
# Clean up temporary files, if they exist. | ||
rm -Rf data-git 2&> /dev/null | ||
rm -Rf dcs-data 2&> /dev/null | ||
|
||
# Exit if any step in this install script fails. | ||
set -e | ||
|
||
# Clean up temporary files, if they exist. | ||
rm -rf data-git | ||
rm -rf dcs-data | ||
|
||
# Create necessary directories. | ||
mkdir -p "data/build/${1}" | ||
|
||
echo "=========================" | ||
echo "| DCS corpus data |" | ||
echo "=========================" | ||
echo | ||
if [ -e "data/raw/dcs" ]; then | ||
|
||
echo -e " | ||
========================= | ||
| DCS corpus data | | ||
========================= | ||
" | ||
|
||
if [[ -e "data/raw/dcs" ]]; then | ||
echo "Training data already exists -- skipping fetch." | ||
else | ||
echo "Training data does not exist -- fetching." | ||
|
||
mkdir -p "data/raw/dcs" | ||
git clone --depth 1 https://github.com/OliverHellwig/sanskrit.git dcs-data | ||
|
||
mv dcs-data/dcs/data/conllu data/raw/dcs/conllu | ||
rm -Rf dcs-data | ||
rm -rf dcs-data | ||
fi | ||
echo | ||
echo "=========================" | ||
echo "| Linguistic data fetch |" | ||
echo "=========================" | ||
echo | ||
if [ -e "data/raw/lex" ]; then | ||
|
||
|
||
echo -e " | ||
========================= | ||
| Linguistic data fetch | | ||
========================= | ||
" | ||
|
||
if [[ -e "data/raw/lex" ]]; then | ||
echo "Lexical data already exists -- skipping fetch." | ||
else | ||
echo "Lexical data does not exist -- fetching." | ||
|
||
mkdir -p "data/raw/lex" | ||
git clone --depth=1 https://github.com/sanskrit/data.git data-git | ||
|
||
python3 data-git/bin/make_data.py --make_prefixed_verbals | ||
mv data-git/all-data/* data/raw/lex | ||
|
||
rm -rf data-git | ||
fi | ||
echo | ||
echo "=========================" | ||
echo "| Vidyut build |" | ||
echo "=========================" | ||
echo | ||
make create_kosha | ||
make test_kosha | ||
make create_sandhi_rules | ||
make train_cheda | ||
make eval_cheda | ||
echo | ||
echo "Complete." | ||
|
||
|
||
echo -e " | ||
========================= | ||
| Vidyut build | | ||
========================= | ||
" | ||
|
||
if [[ "$1" == "" ]]; then | ||
make_cmd="make -j`nproc`" | ||
else | ||
make_cmd=$1 | ||
fi | ||
|
||
$make_cmd create_kosha | ||
$make_cmd test_kosha | ||
$make_cmd create_sandhi_rules | ||
$make_cmd train_cheda | ||
$make_cmd eval_cheda | ||
|
||
|
||
echo -e "\nComplete." |
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,21 +1,27 @@ | ||
#!/usr/bin/env sh | ||
if [[ ! $(command -v wasm-pack) ]] | ||
then | ||
#!/usr/bin/env bash | ||
|
||
set -e # Exit on failure. | ||
|
||
if [[ ! $(command -v wasm-pack) ]]; then | ||
echo "Our debugger requires wasm-pack. Please install wasm-pack:" | ||
echo "https://rustwasm.github.io/wasm-pack/installer/" | ||
echo | ||
exit 1 | ||
fi | ||
|
||
# `cargo` uses the debug build by default, but `wasm-pack` uses the release | ||
# build by default instead. Creating this release build is slow, so instead | ||
# explicitly use the debug build by passing the `--debug` flag. | ||
|
||
wasm-pack build --target web --debug | ||
mkdir -p www/static/wasm && cp pkg/* www/static/wasm | ||
mkdir -p www/static/data && cp data/* www/static/data | ||
cd www \ | ||
&& python3 -m venv env \ | ||
&& . env/bin/activate \ | ||
&& pip3 install -r requirements.txt \ | ||
&& python app.py | ||
|
||
mkdir -p www/static/wasm | ||
cp pkg/* www/static/wasm | ||
|
||
mkdir -p www/static/data | ||
cp data/* www/static/data | ||
|
||
cd www | ||
python3 -m venv env | ||
. env/bin/activate | ||
pip3 install -r requirements.txt | ||
python app.py |