Instructions to use udiboy1209/REMEND with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Fairseq
How to use udiboy1209/REMEND with Fairseq:
from fairseq.checkpoint_utils import load_model_ensemble_and_task_from_hf_hub models, cfg, task = load_model_ensemble_and_task_from_hf_hub( "udiboy1209/REMEND" ) - Notebooks
- Google Colab
- Kaggle
Download remend/convert_generated.py from udiboy1209/REMEND: direct link, hf CLI and curl.
- Browser
- Download file 754 Bytes
-
https://huggingface.co/udiboy1209/REMEND/resolve/main/remend/convert_generated.py
- Command line
-
hf download hf://udiboy1209/REMEND/remend/convert_generated.py
-
curl -L -o convert_generated.py https://huggingface.co/udiboy1209/REMEND/resolve/main/remend/convert_generated.py
754 Bytes
| from .parser import parse_prefix_to_sympy | |
| if __name__ == "__main__": | |
| import argparse | |
| parser = argparse.ArgumentParser("Parse result prefix to equation") | |
| parser.add_argument("--input", required=True, help="Input result file") | |
| args = parser.parse_args() | |
| res_list = [] | |
| with open(args.input, 'r') as f: | |
| for line in f: | |
| comps = line.strip().split("\t") | |
| if line[0] == 'H': | |
| num = int(comps[0][2:]) | |
| tokens = comps[2].split(" ") | |
| res_list.append((num, tokens)) | |
| for n, toks in res_list: | |
| try: | |
| ex = parse_prefix_to_sympy(toks) | |
| print(n, ex) | |
| except Exception as e: | |
| print(n, "could not parse:", str(e)) | |