File size: 3,193 Bytes
3d79eb3
 
 
 
f161f04
3d79eb3
 
 
 
 
 
 
 
 
 
b5a0bec
3d79eb3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
[project]
name = "LexaLCM_Pre0_288M"
readme = "README.md"
requires-python = ">=3.10"
version = "0.0.0_pre0"
description = "A pre-trained LCM model with 288M parameters based on Meta FAIR's LCM architecture."
dependencies = [
  "dacite>=1.8.1",
  "fire>=0.7.0",
  "hydra-core>=1.3.2",
  "importlib-resources~=6.4",
  "numpy>=1.21",
  "polars>=1.16.0",
  "pyarrow>=16.1.0",
  "retrying>=1.3.4",
  "safetensors>=0.5.3",
  "sentence-splitter>=1.4",
  "sonar-space>=0.3.2",
  "stopes[mono]>=2.2.0",
  "tensorboard>=2.18.0",
  "wandb>=0.19.11",
]

classifiers = [
  "License :: OSI Approved :: MIT License",
  "Topic :: Scientific/Engineering",
  "Development Status :: 4 - Beta",
]

[build-system]
requires = ["flit_core >=3.2,<4", "setuptools < 74"]
build-backend = "flit_core.buildapi"

[tool.flit.module]
name = "lcm" # TODO change module name

[project.optional-dependencies]
gpu = [
  "torch==2.5.1",
  "torchaudio==2.5.1",
  "fairseq2n==0.3.0rc1",
  "fairseq2[arrow]==0.3.0rc1",
]
# cpu = [
#   "torch==2.5.1+cpu",
#   "torchaudio==2.5.1+cpu",
#   "fairseq2n==0.3.0rc1",
#   "fairseq2[arrow]==0.3.0rc1",
# ]
eval = [
  "accelerate>=1.2.0",
  "bert-score>=0.3.13",
  "editdistance>=0.8.1",
  "jinja2>=3.1.3",
  "nltk>=3.9.1",
  "rouge-score>=0.1.2",
  "sacrebleu>=2.4.3",
  "scikit-learn>=1.5.2",
  "spacy>=3.7.5",
  "textdescriptives>=2.8.2",
  "tiktoken>=0.8.0",
  "transformers>=4.45.0",
  "fairscale>=0.4.13",
]
data = [
  "numpy>=1.21",
  "numba>=0.60.0",
  "spacy>=3.7.5",
  "en_core_web_sm@https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1-py3-none-any.whl",
  "sacremoses>=0.1.1",
  "nltk>=3.8.1",
  "scipy>=1.14",
  "editdistance>=0.8.1",
  "sacrebleu>=2.4.1",
  "datasets>=2.18.0",
  "wtpsplit>=2.1.0",
  "transformers>=4.45.0",
]


[tool.ruff]
target-version = "py310"

[tool.mypy]
python_version = "3.10"
show_error_codes = true
check_untyped_defs = true
ignore_missing_imports = true
implicit_optional = true
implicit_reexport = true

files = [
  "lcm/", # TODO
]

[tool.uv]
prerelease = "explicit" # for fairseq2 0.3.0rc1

# TODO Change versions
[tool.uv.sources]
fairseq2 = [
  { index = "fairseq2-gpu", extra = 'gpu' },
  # { index = "fairseq2-cpu", extra = 'cpu' }
]
fairseq2n = [
  { index = "fairseq2-gpu", extra = 'gpu' },
  # { index = "fairseq2-cpu", extra = 'cpu' }
]
torch={index="pytorch-gpu"}
torchaudio={index="pytorch-gpu"}
# torch={index="pytorch-cpu"}
# torchaudio={index="pytorch-cpu"}
# sonar-space = { git = "https://github.com/facebookresearch/SONAR", branch = "update_fs2" } # TODO

[[tool.uv.index]]
name = "fairseq2-gpu"
url = "https://fair.pkg.atmeta.com/fairseq2/whl/rc/pt2.5.1/cu121"
explicit = true

# [[tool.uv.index]]
# name = "fairseq2-cpu"
# url = "https://fair.pkg.atmeta.com/fairseq2/whl/rc/pt2.5.1/cpu/"
# explicit = true

[[tool.uv.index]]
name = "pytorch-gpu"
url = "https://download.pytorch.org/whl/cu121"
explicit = true

# [[tool.uv.index]]
# name = "pytorch-cpu"
# url = "https://download.pytorch.org/whl/cpu"
# explicit = true

[dependency-groups]
dev = ["pytest-asyncio>=0.23.2", "pytest>=8.0.0"]


[project.entry-points."fairseq2"]
"fairseq2" = "lcm:setup_fairseq2" # TODO update lcm