Download lm-evaluation-harness/lm_eval/tasks/code_x_glue/code-text/utils.py from chen459664/quantization2: direct link, hf CLI and curl.
- Browser
- Download file 308 Bytes
-
https://huggingface.co/chen459664/quantization2/resolve/main/lm-evaluation-harness/lm_eval/tasks/code_x_glue/code-text/utils.py
- Command line
-
hf download hf://chen459664/quantization2/lm-evaluation-harness/lm_eval/tasks/code_x_glue/code-text/utils.py
-
curl -L -o utils.py https://huggingface.co/chen459664/quantization2/resolve/main/lm-evaluation-harness/lm_eval/tasks/code_x_glue/code-text/utils.py
308 Bytes
| def doc_to_text(doc): | |
| inputs = " ".join(doc["code_tokens"]).replace("\n", " ") | |
| inputs = " ".join(inputs.strip().split()) | |
| return inputs | |
| def doc_to_target(doc): | |
| targets = " ".join(doc["docstring_tokens"]).replace("\n", "") | |
| targets = " ".join(targets.strip().split()) | |
| return targets | |