-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(src/models): add symbolic link solution for windows
docs(src/models): improve docs fix(src/models): fix interpolation error when no constraints fix(src/models): catch CP result parsing error from pyevalb docs(improve README and remove legacy code files):
- Loading branch information
Saibo Geng
committed
Oct 11, 2023
1 parent
9edad10
commit 69cf23f
Showing
38 changed files
with
105 additions
and
1,797 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -4,5 +4,4 @@ defaults: | |
|
||
linearization_class_id: ${datamodule.linearization_class_id} | ||
|
||
|
||
_target_: src.models.IE_model.IEHFModelPL |
This file was deleted.
Oops, something went wrong.
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,73 @@ | ||
# Run experiments | ||
|
||
## requirements | ||
|
||
Check the env variable is set correctly | ||
```shell | ||
echo $HF_MODELS_DIR | ||
``` | ||
|
||
Check the data and grammar objects are downloaded correctly | ||
```shell | ||
ls data assets/grammar_objects | ||
# -> CP ED IE | ||
``` | ||
|
||
Check the pre-trained models are downloaded correctly | ||
```shell | ||
ls assets/pgf | ||
# -> CP ED IE | ||
``` | ||
|
||
If anything is missing, check the [docs/download_data.md](docs/download_data.md) for instructions on how to set it. | ||
|
||
|
||
## Run the experiments | ||
|
||
### Quick start | ||
|
||
Suppose you have already `LLAMA-7B` in `$HF_MODELS_DIR`, run the following commands: | ||
|
||
```shell | ||
# run the experiments for the CP task | ||
bash run_CP.sh LLAMA-7B | ||
|
||
# run the experiments for the IE task | ||
bash run_IE.sh LLAMA-7B | ||
|
||
# run the experiments for the ED task | ||
bash run_ED.sh LLAMA-7B | ||
``` | ||
|
||
The above scripts will run the experiments for the CP, IE and ED tasks respectively with a few data samples. | ||
To run the experiments with the full dataset, please remove the `datamodule.debug_k=2` option in the scripts. | ||
|
||
## Results | ||
|
||
The generated prediction sequences will be logged to [Weights and Biases](https://wandb.ai/site). | ||
|
||
## Dry run | ||
|
||
If you don't have the model yet, you can run the experiments with a dummy model. | ||
```shell | ||
# run the experiments for the CP task | ||
bash run_CP.sh saibo/llama-1B | ||
``` | ||
|
||
`saibo/llama-1B` is a dummy model that has the same tokenizer as `LLAMA-7B` but with random weights. | ||
It only has two layers so it's much smaller. | ||
But as the model is randomly initialized, the results will be meaningless. | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
## Run experiments without constraints | ||
|
||
You can check the results of the experiments without constraints by removing the constraints flags in the scripts. | ||
|
||
For example, remove `+constraint/gf_constraint_module/[email protected]_constraint_module="$gf_constraint_module_option"` in `run_CP.sh` will run the experiments without constraints. | ||
|
||
|
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,16 @@ | ||
# Windows Specific Setting | ||
|
||
## Symbolic Link | ||
|
||
This project uses symbolic links to point to the stable version of prompts used for each task. | ||
While symbolic links are supported on Linux and MacOS, they are not supported on Windows. | ||
If you are on Windows, the following files will be plain text files instead of symbolic links: | ||
`assets/prompts/CP/stable`, `assets/prompts/ED/stable`, `assets/prompts/IE/stable` | ||
|
||
They are plain text files that contain the path to the stable version of prompts used for each task. | ||
|
||
You can manually copy the target directory to `assets/prompts/CP/stable`, `assets/prompts/ED/stable`, `assets/prompts/IE/stable` to make the code work. | ||
|
||
|
||
|
||
|
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 |
---|---|---|
|
@@ -22,5 +22,5 @@ python run_inference.py \ | |
+constraint/gf_constraint_module/[email protected]_constraint_module="$gf_constraint_module_option" \ | ||
model.pretrained_model_name_or_path="$HF_MODELS_DIR/$model" \ | ||
model.half_precision=false \ | ||
datamodule.debug_k=2 \ | ||
datamodule.debug_k=16 \ | ||
logger.wandb.offline=false |
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 |
---|---|---|
|
@@ -24,7 +24,7 @@ for ds in aquaint msnbc ace2004 wiki aida clueweb; do | |
datamodule="$datamodule_option" \ | ||
trainer="$trainer_option" \ | ||
model="$model_option" \ | ||
+constraint/gf_constraint_module/[email protected]_constraint_module=canonical_aida \ | ||
+constraint/gf_constraint_module/[email protected]_constraint_module=canonical \ | ||
model.pretrained_model_name_or_path="$HF_MODELS_DIR/$model" \ | ||
model.half_precision=false \ | ||
model.gf_constraint_module.grammar_module="$grammar_module" \ | ||
|
Oops, something went wrong.