Skip to content

Commit a898390

Browse files
RyanMullinsLIT team
authored andcommitted
README updates to accommodate LIT on GCP changes.
PiperOrigin-RevId: 688520131
1 parent 0c68496 commit a898390

File tree

5 files changed

+65
-63
lines changed

5 files changed

+65
-63
lines changed

README.md

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -51,91 +51,81 @@ For a broader overview, check out [our paper](https://arxiv.org/abs/2008.05122)
5151

5252
## Download and Installation
5353

54-
LIT can be run via container image, installed via `pip` or built from source.
55-
Building from source is necessary if you update any of the front-end or core
56-
back-end code.
54+
LIT can be installed via `pip` or built from source. Building from source is
55+
necessary if you want to make code changes.
5756

58-
### Build container image
57+
### Install from PyPI with pip
5958

60-
Build the image using `docker` or `podman`:
6159
```sh
62-
git clone https://github.com/PAIR-code/lit.git && cd lit
63-
docker build --file Dockerfile --tag lit-nlp .
60+
pip install lit-nlp
6461
```
6562

66-
See the [advanced guide](https://pair-code.github.io/lit/documentation/docker) for detailed instructions on using the
67-
default LIT Docker image, running LIT as a containerized web app in different
68-
scenarios, and how to creating your own LIT images.
69-
70-
### pip installation
63+
The default `pip` installation will install all required packages to use the LIT
64+
Python API, built-in interpretability components, and web application. To
65+
install dependencies for the provided demos or test suite, install LIT with the
66+
appropriate optional dependencies.
7167

7268
```sh
73-
pip install lit-nlp
74-
```
69+
# To install dependencies for the discriminative AI examples (GLUE, Penguin)
70+
pip install 'lit-nlp[examples-discriminative-ai]'
7571

76-
The `pip` installation will install all necessary prerequisite packages for use
77-
of the core LIT package.
72+
# To install dependencies for the generative AI examples (Prompt Debugging)
73+
pip install 'lit-nlp[examples-generative-ai]'
7874

79-
It **does not** install the prerequisites for the provided demos, so you need to
80-
install those yourself. See
81-
[requirements_examples.txt](./requirements_examples.txt) for the list of
82-
packages required to run the demos.
75+
# To install dependencies for all examples plus the test suite
76+
pip install 'lit-nlp[test]'
77+
```
8378

8479
### Install from source
8580

8681
Clone the repo:
8782

8883
```sh
89-
git clone https://github.com/PAIR-code/lit.git && cd lit
84+
git clone https://github.com/PAIR-code/lit.git
85+
cd lit
9086
```
9187

92-
9388
Note: be sure you are running Python 3.9+. If you have a different version on
9489
your system, use the `conda` instructions below to set up a Python 3.9
9590
environment.
9691

97-
Set up a Python environment with `venv`:
92+
Set up a Python environment with `venv` (or your preferred environment manager).
93+
Note that these instructions assume you will be making code changes to LIT and
94+
includes the full requirements for all examples and the test suite. See the
95+
other optional dependency possibilities in the install with pip section.
9896

9997
```sh
10098
python -m venv .venv
10199
source .venv/bin/activate
100+
python -m pip install -e '.[test]'
102101
```
103102

104-
Or set up a Python environment using `conda`:
103+
The LIT repo does not include a distributable version of the LIT app. You must
104+
build it from source.
105105

106106
```sh
107-
conda create --name lit-nlp
108-
conda activate lit-nlp
109-
conda install python=3.9
110-
conda install pip
111-
```
112-
113-
Once you have the environment, install LIT's dependencies:
114-
```sh
115-
python -m pip install -r requirements.txt
116-
python -m pip install cudnn cupti # optional, for GPU support
117-
python -m pip install torch # optional, for PyTorch
118-
119-
# Build the frontend
120107
(cd lit_nlp; yarn && yarn build)
121108
```
122109

123-
Note: Use the `-r requirements.txt` option to install every dependency required
124-
for the LIT library, its test suite, and the built-in examples. You can also
125-
install subsets of these using the `-r requirements_core.txt` (core library),
126-
`-r requirements_test.txt` (test suite), `-r requirements_examples.txt`
127-
(examples), and/or any combination thereof.
128-
129110
Note: if you see [an error](https://github.com/yarnpkg/yarn/issues/2821)
130111
running `yarn` on Ubuntu/Debian, be sure you have the
131112
[correct version installed](https://yarnpkg.com/en/docs/install#linux-tab).
132113

133-
134114
## Running LIT
135115

136116
Explore a collection of hosted demos on the
137117
[demos page](https://pair-code.github.io/lit/demos).
138118

119+
### Using container images
120+
121+
See the [containerization guide](https://pair-code.github.io/lit/documentation/docker) for instructions on using LIT
122+
locally in Docker, Podman, etc.
123+
124+
LIT also provides pre-built images that can take advantage of accelerators,
125+
making Generative AI and LLM use cases easier to work with. Check out the
126+
[LIT on GCP docs](https://codelabs.developers.google.com/codelabs/responsible-ai/lit-on-gcp)
127+
for more.
128+
139129
### Quick-start: classification and regression
140130

141131
To explore classification and regression models tasks from the popular
@@ -154,7 +144,6 @@ but you can switch to
154144
[STS-B](http://ixa2.si.ehu.es/stswiki/index.php/STSbenchmark) or
155145
[MultiNLI](https://cims.nyu.edu/~sbowman/multinli/) using the toolbar or the
156146
gear icon in the upper right.
157-
```
158147

159148
And navigate to http://localhost:5432 for the UI.
160149

@@ -220,18 +209,19 @@ Google's [Python](https://google.github.io/styleguide/pyguide.html) and
220209

221210
```sh
222211
# Run Pylint on your code using the following command from the root of this repo
223-
pushd lit_nlp & pylint & popd
212+
(cd lit_nlp; pylint)
224213

225214
# Run ESLint on your code using the following command from the root of this repo
226-
pushd lit_nlp & yarn lint & popd
215+
(cd lit_nlp; yarn lint)
227216
```
228217

229218
## Citing LIT
230219

231-
If you use LIT as part of your work, please cite
232-
[our EMNLP paper](https://arxiv.org/abs/2008.05122):
220+
If you use LIT as part of your work, please cite the
221+
[EMNLP paper](https://arxiv.org/abs/2008.05122) or the
222+
[Sequence Salience paper](https://arxiv.org/abs/2404.07498)
233223

234-
```
224+
```BibTeX
235225
@misc{tenney2020language,
236226
title={The Language Interpretability Tool: Extensible, Interactive Visualizations and Analysis for {NLP} Models},
237227
author={Ian Tenney and James Wexler and Jasmijn Bastings and Tolga Bolukbasi and Andy Coenen and Sebastian Gehrmann and Ellen Jiang and Mahima Pushkarna and Carey Radebaugh and Emily Reif and Ann Yuan},
@@ -243,12 +233,22 @@ If you use LIT as part of your work, please cite
243233
}
244234
```
245235

236+
```BibTeX
237+
@article{tenney2024interactive,
238+
title={Interactive prompt debugging with sequence salience},
239+
author={Tenney, Ian and Mullins, Ryan and Du, Bin and Pandya, Shree and Kahng, Minsuk and Dixon, Lucas},
240+
journal={arXiv preprint arXiv:2404.07498},
241+
year={2024}
242+
}
243+
```
244+
246245
## Disclaimer
247246

248247
This is not an official Google product.
249248

250-
LIT is a research project and under active development by a small team. There
251-
will be some bugs and rough edges, but we're releasing at an early stage because
252-
we think it's pretty useful already. We want LIT to be an open platform, not a
253-
walled garden, and we would love your suggestions and feedback - drop us a line
254-
in the [issues](https://github.com/pair-code/lit/issues).
249+
LIT is a research project and under active development by a small team. We want
250+
LIT to be an open platform, not a walled garden, and would love your suggestions
251+
and feedback – please
252+
[report any bugs](https://github.com/pair-code/lit/issues) and reach out on the
253+
[Discussions page](https://github.com/PAIR-code/lit/discussions/landing).
254+

pyproject.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "lit-nlp"
7+
# LINT.IfChange
78
version = "1.2"
9+
# LINT.ThenChange(./lit_nlp/package.json)
810
authors = [
911
{ name="Google, LLC", email="[email protected]" }
1012
]
@@ -85,14 +87,14 @@ examples-common = [
8587
]
8688
# LINT.ThenChange(./requirements_examples_common.txt)
8789
# LINT.IfChange
88-
examples-descai = [
90+
examples-discriminative-ai = [
8991
"lit-nlp[examples-common]",
9092
"tensorflow-datasets>=4.9.0",
9193
"tf-keras>=2.16",
9294
]
93-
# LINT.ThenChange(./requirements_examples_descai.txt)
95+
# LINT.ThenChange(./requirements_examples_discriminative_ai.txt)
9496
# LINT.IfChange
95-
examples-genai = [
97+
examples-generative-ai = [
9698
"lit-nlp[examples-common]",
9799
"google-cloud-aiplatform>=1.60.0",
98100
"keras>=3.0.0",
@@ -102,11 +104,11 @@ examples-genai = [
102104
"torch>=2.0.0",
103105
"vertexai>=1.49.0",
104106
]
105-
# LINT.ThenChange(./requirements_examples_genai.txt)
107+
# LINT.ThenChange(./requirements_examples_generative_ai.txt)
106108
# LINT.IfChange
107109
test = [
108-
"lit-nlp[examples-descai]",
109-
"lit-nlp[examples-genai]",
110+
"lit-nlp[examples-discriminative-ai]",
111+
"lit-nlp[examples-generative-ai]",
110112
"lime==0.2.0.1",
111113
"pytest>=7.4.0,<8.0.0",
112114
"webtest>=2.0",
File renamed without changes.
File renamed without changes.

requirements_test.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414
# ==============================================================================
1515
# LINT.IfChange
16-
-r requirements_examples_descai.txt
17-
-r requirements_examples_genai.txt
16+
-r requirements_examples_discriminative_ai.txt
17+
-r requirements_examples_generative_ai.txt
1818

1919
lime==0.2.0.1
2020
pytest>=7.4.0,<8.0.0

0 commit comments

Comments
 (0)