├── .gitignore ├── LICENSE ├── README.md ├── benchmark ├── config │ ├── dataset2maxlen.json │ ├── dataset2passageprefix.json │ ├── dataset2prompt.json │ └── dataset2queryprefix.json ├── download.py ├── eval.py ├── further_results.md ├── infinitebench_eval.py ├── metrics.py └── pred.py ├── config ├── llama3.yaml ├── llama31.yaml ├── mistral.yaml ├── phi35_mini.yaml └── phi3_mini.yaml ├── em_llm ├── __init__.py ├── attention │ ├── __init__.py │ ├── context_manager.py │ ├── dot_product_attention │ │ ├── __init__.py │ │ ├── base.py │ │ └── torch_impl.py │ ├── em_llm.py │ ├── rope.py │ ├── similarity_refinement │ │ ├── __init__.py │ │ ├── segmentation.py │ │ └── similarity.py │ └── utils.py └── utils │ ├── __init__.py │ ├── greedy_search.py │ └── patch_hf.py ├── en_core_web_sm-3.7.1-py3-none-any.whl ├── images ├── architecture.png └── emllm_rag_fc.png ├── requirements.txt ├── scripts ├── download.sh └── run.sh └── setup.py /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/.gitignore -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/README.md -------------------------------------------------------------------------------- /benchmark/config/dataset2maxlen.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/benchmark/config/dataset2maxlen.json -------------------------------------------------------------------------------- /benchmark/config/dataset2passageprefix.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/benchmark/config/dataset2passageprefix.json -------------------------------------------------------------------------------- /benchmark/config/dataset2prompt.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/benchmark/config/dataset2prompt.json -------------------------------------------------------------------------------- /benchmark/config/dataset2queryprefix.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/benchmark/config/dataset2queryprefix.json -------------------------------------------------------------------------------- /benchmark/download.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/benchmark/download.py -------------------------------------------------------------------------------- /benchmark/eval.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/benchmark/eval.py -------------------------------------------------------------------------------- /benchmark/further_results.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/benchmark/further_results.md -------------------------------------------------------------------------------- /benchmark/infinitebench_eval.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/benchmark/infinitebench_eval.py -------------------------------------------------------------------------------- /benchmark/metrics.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/benchmark/metrics.py -------------------------------------------------------------------------------- /benchmark/pred.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/benchmark/pred.py -------------------------------------------------------------------------------- /config/llama3.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/config/llama3.yaml -------------------------------------------------------------------------------- /config/llama31.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/config/llama31.yaml -------------------------------------------------------------------------------- /config/mistral.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/config/mistral.yaml -------------------------------------------------------------------------------- /config/phi35_mini.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/config/phi35_mini.yaml -------------------------------------------------------------------------------- /config/phi3_mini.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/config/phi3_mini.yaml -------------------------------------------------------------------------------- /em_llm/__init__.py: -------------------------------------------------------------------------------- 1 | from .utils import patch_hf, GreedySearch -------------------------------------------------------------------------------- /em_llm/attention/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/em_llm/attention/__init__.py -------------------------------------------------------------------------------- /em_llm/attention/context_manager.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/em_llm/attention/context_manager.py -------------------------------------------------------------------------------- /em_llm/attention/dot_product_attention/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/em_llm/attention/dot_product_attention/__init__.py -------------------------------------------------------------------------------- /em_llm/attention/dot_product_attention/base.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/em_llm/attention/dot_product_attention/base.py -------------------------------------------------------------------------------- /em_llm/attention/dot_product_attention/torch_impl.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/em_llm/attention/dot_product_attention/torch_impl.py -------------------------------------------------------------------------------- /em_llm/attention/em_llm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/em_llm/attention/em_llm.py -------------------------------------------------------------------------------- /em_llm/attention/rope.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/em_llm/attention/rope.py -------------------------------------------------------------------------------- /em_llm/attention/similarity_refinement/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/em_llm/attention/similarity_refinement/__init__.py -------------------------------------------------------------------------------- /em_llm/attention/similarity_refinement/segmentation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/em_llm/attention/similarity_refinement/segmentation.py -------------------------------------------------------------------------------- /em_llm/attention/similarity_refinement/similarity.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/em_llm/attention/similarity_refinement/similarity.py -------------------------------------------------------------------------------- /em_llm/attention/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/em_llm/attention/utils.py -------------------------------------------------------------------------------- /em_llm/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/em_llm/utils/__init__.py -------------------------------------------------------------------------------- /em_llm/utils/greedy_search.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/em_llm/utils/greedy_search.py -------------------------------------------------------------------------------- /em_llm/utils/patch_hf.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/em_llm/utils/patch_hf.py -------------------------------------------------------------------------------- /en_core_web_sm-3.7.1-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/en_core_web_sm-3.7.1-py3-none-any.whl -------------------------------------------------------------------------------- /images/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/images/architecture.png -------------------------------------------------------------------------------- /images/emllm_rag_fc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/images/emllm_rag_fc.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/requirements.txt -------------------------------------------------------------------------------- /scripts/download.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/scripts/download.sh -------------------------------------------------------------------------------- /scripts/run.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/scripts/run.sh -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/em-llm/EM-LLM-model/HEAD/setup.py --------------------------------------------------------------------------------