{"id":20652493,"url":"https://github.com/thesofakillers/claficle","last_synced_at":"2026-07-06T21:31:32.393Z","repository":{"id":70961824,"uuid":"491443452","full_name":"thesofakillers/CLAfICLe","owner":"thesofakillers","description":"Official repository for the paper \"CLAfICLe: Cross-Lingual Adaptation for In-Context Learning\". Not Published.","archived":false,"fork":false,"pushed_at":"2023-06-28T10:30:51.000Z","size":14534,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T21:45:06.614Z","etag":null,"topics":["adapters","gpt2","multilingual-nlp","nlp","python","transformers"],"latest_commit_sha":null,"homepage":"","language":"TeX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thesofakillers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-12T09:15:44.000Z","updated_at":"2023-03-16T09:51:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"a4e0bcc1-12dd-47ad-bac4-1efa8b7a65a8","html_url":"https://github.com/thesofakillers/CLAfICLe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thesofakillers/CLAfICLe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesofakillers%2FCLAfICLe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesofakillers%2FCLAfICLe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesofakillers%2FCLAfICLe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesofakillers%2FCLAfICLe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thesofakillers","download_url":"https://codeload.github.com/thesofakillers/CLAfICLe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thesofakillers%2FCLAfICLe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35206987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-06T02:00:07.184Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adapters","gpt2","multilingual-nlp","nlp","python","transformers"],"created_at":"2024-11-16T17:35:19.747Z","updated_at":"2026-07-06T21:31:31.855Z","avatar_url":"https://github.com/thesofakillers.png","language":"TeX","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CLAfICLe\n\nRead our paper:\n\n[Cross-Lingual Adaptation for In-Context Learning [PDF]](./reports/report/main.pdf) (Not submitted for publication)\n\n**Contents**\n\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [Requirements and Setup](#requirements-and-setup)\n    * [Required Packages](#required-packages)\n    * [Checkpoints](#checkpoints)\n* [Model Reference](#model-reference)\n* [Usage](#usage)\n* [Project Organization](#project-organization)\n\n\u003c!-- vim-markdown-toc --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n## Requirements and Setup\n\n### Required Packages\n\nDetails such as python and package versions can be found in the generated\n[pyproject.toml](pyproject.toml) and [poetry.lock](poetry.lock) files.\n\nWe recommend using an environment manager such as\n[conda](https://docs.conda.io/en/latest/). After setting up your environment\nwith the correct python version, please proceed with the installation of the\nrequired packages\n\nFor [poetry](https://python-poetry.org/) users, getting setup is as easy as\nrunning\n\n```terminal\npoetry install\n```\n\nWe also provide a [requirements.txt](requirements.txt) file for\n[pip](https://pypi.org/project/pip/) users who do not wish to use poetry. In\nthis case, simply run\n\n```terminal\npip install -r requirements.txt\n```\n\nThis `requirements.txt` file is generated by running the following\n\n```terminal\nsh gen_pip_reqs.sh\n```\n\n### Checkpoints\n\nIf you wish to run evaluation without first training the model, we provide our\ncheckpoints via [The Internet Archive](https://archive.org/) at\n[this link](https://archive.org/download/claficle/checkpoints.zip). Please unzip\nthis folder and organize it such that the checkpoints are in the `checkpoints`\nfolder at the root of this repository.\n\nWe do not provide the bare `hr_to_lr` MetaICL model checkpoint. For this\ncheckpoint, please refer to the instructions on the\n[MetaICL repo](https://github.com/facebookresearch/MetaICL) for downloading\ntheir `metaicl` model in the `hr_to_lr` setting. Once downloaded, rename this to\n`metaicl.pt` and place it in the relevant checkpoints directory.\n\n## Model Reference\n\nThe following table provides a reference for the models evaluated in our paper.\n\n| **Model Name**                  | **Evaluation Languages** | **Description**                                                                                                                                                                                    |\n| ------------------------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `metaicl`                       | en                       | `direct` `hr_to_lr` checkpoint from the [MetaICL repo](https://github.com/facebookresearch/MetaICL)                                                                                                |\n| `sandwich-{lang}`               | fr, de                   | `metaicl` sandwiched in a translation API for `lang`, serving as a baseline                                                                                                                        |\n| `metaicl-gewechselt-{lang}-clm` | fr, de                   | `metaicl` adapted to a `lang` (fr or de) using [WECHSEL](https://github.com/CPJKU/wechsel), 0 shot or with the additional recommended CLM training.                                                |\n| `gpt2-gewechselt-{lang}-clm`    | not evaluated            | `gpt2` adapted to `lang` (fr or de) using [WECHSEL](https://github.com/CPJKU/wechsel) with additional recommended CLM training. Note, we do not actually evaluate this buut only use it as a base. |\n| `{base}-metaicla`               | fr, de                   | A `base` (any of the `gpt2-gewechselt-{lang}-clm`) with a MetaICL adapter, trained the standard way.                                                                                               |\n| `{base}-metaiclva`              | fr, de                   | A `base` (any of the `gpt2-gewechselt-{lang}-clm`) with a MetaICL _vessel_ adapter, trained with targeted distillation.                                                                            |\n\n## Usage\n\nWe use [hydra](https://hydra.cc/) for configuring our project.\n\nTo download/process the data, either run\n[claficle/data/oscar.py](claficle/data/oscar.py) or\n[claficle/data/benchmark.py](claficle/data/benchmark.py) for OSCAR and our\nmulti-lingual multi-task benchmark respectively. You may have to configure or\noverride [claficle/conf/setup_data.yaml](claficle/conf/setup_data.yaml)\naccordingly. We suggest inspecting [slurm/data/](slurm/data/) for examples of\nhow we ran these.\n\nNote that to process OSCAR in French and German data you need to make use of\ntrained tokenizers from WECHSEL initialization. You can either download these\nalong with our checkpoints or run WECHSEL initalization yourself by running\n[claficle/models/gewechselt.py](claficle/models/gewechselt.py), configured with\n[claficle/conf/wechsel_init.yaml](claficle/conf/wechsel_init.yaml). We have\nexamples of how we ran this in [slurm/wechsel/](slurm/wechsel_init/).\n\nOnce the data is downloaded, to run evaluation run\n[claficle/run/eval.py](claficle/run/eval.py), configured with\n[claficle/conf/eval.yaml](claficle/conf/eval.yaml). Examples at\n[slurm/eval/](slurm/eval/).\n\nOf course, to run evaluation you need trained checkpoints. You can once again\neither download these or train them yourself. For geWECHSELt models, you can\nrun [claficle/run/train.py](claficle/run/train.py). For MetaICLVA, you can run\n[claficle/run/distil.py](claficle/run/distil.py). For MetaICLA, please refer to\n[our MetaICL fork](https://github.com/thesofakillers/metaICLA). Like always,\nthese are configured with the relevant files in\n[claficle/conf/](claficle/conf/) and are accompanies by examples of how we did\nit in [slurm/](slurm/).\n\n## Project Organization\n\n```plaintext\n    ├── LICENSE\n    ├── README.md          \u003c- The top-level README\n    ├── data/\n    │   ├── interim/       \u003c- Intermediate data that has been transformed.\n    │   ├── processed/     \u003c- The final, canonical data sets for modeling.\n    │   └── raw/           \u003c- The original, immutable data dump.\n    ├── checkpoints/       \u003c- Trained and serialized models.\n    ├── notebooks/         \u003c- Jupyter notebooks.\n    ├── slurm/             \u003c- SLURM scripts\n    ├── logs/              \u003c- logs\n    ├── reports            \u003c- Generated analysis as HTML, PDF, LaTeX, etc.\n    ├── pyproject.toml     \u003c- project metadata, handled by poetry.\n    ├── poetry.lock        \u003c- resolving and locking dependencies, handled by poetry.\n    ├── requirements.txt   \u003c- for non-poetry users.\n    ├── gen_pip_reqs.sh    \u003c- for generating the pip requirements.txt file\n    └── claficle/          \u003c- Source code for use in this project.\n        ├── __init__.py    \u003c- Makes src a Python module\n        ├── data/          \u003c- Scripts to download or generate data\n        ├── models/        \u003c- Model definitions\n        ├── run/           \u003c- scripts to train, evaluate and use models\n        ├── conf/          \u003c- config files\n        ├── utils/         \u003c- miscellaneous utils\n        └── visualization/ \u003c- Scripts for visualization\n```\n\nThe project structure is largely based on the\n[cookiecutter data-science template](https://github.com/drivendata/cookiecutter-data-science).\nThis is purposely opinionated so that paths align over collaborators without\nhaving to edit config files. Users may find the\n[cookiecutter data-science opinions page](http://drivendata.github.io/cookiecutter-data-science/#opinions),\nof relevance\n\nThe top level `data/` and `models/` directory are in version control only to\nshow structure. Their contents will not be committed and are ignored via\n`.gitignore`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthesofakillers%2Fclaficle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthesofakillers%2Fclaficle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthesofakillers%2Fclaficle/lists"}