alvinhenrick commited on
Commit
453adc8
0 Parent(s):

Initial commit

Browse files
.gitignore ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Python template
2
+ # Byte-compiled / optimized / DLL files
3
+ __pycache__/
4
+ *.py[cod]
5
+ *$py.class
6
+
7
+ # C extensions
8
+ *.so
9
+
10
+ # Distribution / packaging
11
+ .Python
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # poetry
99
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
103
+ #poetry.lock
104
+
105
+ # pdm
106
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
107
+ #pdm.lock
108
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
109
+ # in version control.
110
+ # https://pdm.fming.dev/#use-with-ide
111
+ .pdm.toml
112
+
113
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
114
+ __pypackages__/
115
+
116
+ # Celery stuff
117
+ celerybeat-schedule
118
+ celerybeat.pid
119
+
120
+ # SageMath parsed files
121
+ *.sage.py
122
+
123
+ # Environments
124
+ .env
125
+ .venv
126
+ env/
127
+ venv/
128
+ ENV/
129
+ env.bak/
130
+ venv.bak/
131
+
132
+ # Spyder project settings
133
+ .spyderproject
134
+ .spyproject
135
+
136
+ # Rope project settings
137
+ .ropeproject
138
+
139
+ # mkdocs documentation
140
+ /site
141
+
142
+ # mypy
143
+ .mypy_cache/
144
+ .dmypy.json
145
+ dmypy.json
146
+
147
+ # Pyre type checker
148
+ .pyre/
149
+
150
+ # pytype static type analyzer
151
+ .pytype/
152
+
153
+ # Cython debug symbols
154
+ cython_debug/
155
+
156
+ # PyCharm
157
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
158
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
159
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
160
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
161
+ .idea/
.pre-commit-config.yaml ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ repos:
2
+ # general checks (see here: https://pre-commit.com/hooks.html)
3
+ - repo: https://github.com/pre-commit/pre-commit-hooks
4
+ rev: v4.6.0
5
+ hooks:
6
+ - id: check-yaml
7
+ args: [--allow-multiple-documents]
8
+ - id: end-of-file-fixer
9
+ - id: trailing-whitespace
10
+
11
+ # ruff - linting + formatting
12
+ - repo: https://github.com/astral-sh/ruff-pre-commit
13
+ rev: "v0.4.9"
14
+ hooks:
15
+ - id: ruff
16
+ name: ruff
17
+ - id: ruff-format
18
+ name: ruff-format
19
+
20
+ # mypy - lint-like type checking
21
+ - repo: https://github.com/pre-commit/mirrors-mypy
22
+ rev: v1.10.0
23
+ hooks:
24
+ - id: mypy
25
+ name: mypy
26
+
27
+ # docformatter - formats docstrings to follow PEP 257
28
+ - repo: https://github.com/pycqa/docformatter
29
+ rev: v1.7.5
30
+ hooks:
31
+ - id: docformatter
32
+ name: docformatter
33
+ args:
34
+ [
35
+ -r,
36
+ -i,
37
+ --pre-summary-newline,
38
+ --make-summary-multi-line,
39
+ --wrap-summaries,
40
+ "120",
41
+ --wrap-descriptions,
42
+ "120",
43
+ medirag,
44
+ tests,
45
+ ]
46
+
47
+ # bandit - find common security issues
48
+ - repo: https://github.com/pycqa/bandit
49
+ rev: 1.7.9
50
+ hooks:
51
+ - id: bandit
52
+ name: bandit
53
+ exclude: ^tests/
54
+ args:
55
+ - -r
56
+ - medirag
57
+
58
+ # - repo: local
59
+ # hooks:
60
+ # - id: pytest
61
+ # name: pytest
62
+ # entry: poetry run pytest --cov=medirag tests
63
+ # language: system
64
+ # types: [python]
65
+ # pass_filenames: false
66
+
67
+ # prettier - formatting JS, CSS, JSON, Markdown, ...
68
+ - repo: https://github.com/pre-commit/mirrors-prettier
69
+ rev: v3.1.0
70
+ hooks:
71
+ - id: prettier
72
+ exclude: ^poetry.lock
medirag/__init__.py ADDED
File without changes
medirag/cache/__init__.py ADDED
File without changes
medirag/index/__init__.py ADDED
File without changes
poetry.lock ADDED
The diff for this file is too large to render. See raw diff
 
pyproject.toml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [tool.poetry]
2
+ name = "medirag"
3
+ version = "0.1.0"
4
+ description = ""
5
+ authors = ["Alvin Henrick <[email protected]>"]
6
+ readme = "README.md"
7
+
8
+ [tool.poetry.dependencies]
9
+ python = "^3.10"
10
+ llama-index = "^0.10.62"
11
+ llama-index-vector-stores-faiss = "^0.1.2"
12
+ llama-index-embeddings-huggingface = "^0.2.2"
13
+ beautifulsoup4 = "^4.12.3"
14
+ lxml = "^5.2.2"
15
+ langchain = "^0.2.12"
16
+ faiss-cpu = "^1.8.0.post1"
17
+ sentence-transformers = "^3.0.1"
18
+
19
+
20
+ [tool.poetry.group.dev.dependencies]
21
+ pytest = "^8.3.2"
22
+ pre-commit = "^3.8.0"
23
+ pytest-cov = "^5.0.0"
24
+
25
+
26
+ [tool.ruff]
27
+ extend-exclude = [
28
+ "__pycache__",
29
+ "build",
30
+ "dist",
31
+ ]
32
+ # Same as Black.
33
+ line-length = 120
34
+
35
+ [build-system]
36
+ requires = ["poetry-core"]
37
+ build-backend = "poetry.core.masonry.api"
38
+
39
+ [tool.pytest.ini_options]
40
+ addopts = "-vvv"
41
+ testpaths = "tests"
tests/__init__.py ADDED
File without changes