File tree Expand file tree Collapse file tree 9 files changed +53
-41
lines changed
Expand file tree Collapse file tree 9 files changed +53
-41
lines changed Original file line number Diff line number Diff line change @@ -15,5 +15,6 @@ docs/documentation/.doctrees/**
1515
1616** /.DS_Store
1717.dalle-venv /
18+ .tydi-venv /
1819.venv /
1920.vscode /
Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ LIT repo.
2121python -m venv .dalle-venv
2222source .dalle-venv/bin/activate
2323# This requirements.txt file will also install the core LIT library deps.
24- pip install -r ./lit_nlp/examples/dalle-mini /requirements.txt
25- # The LIT web app can still needs be built in the usual way.
24+ pip install -r ./lit_nlp/examples/dalle/requirements.txt
25+ # The LIT web app still needs to be built in the usual way.
2626(cd ./lit_nlp && yarn && yarn build)
2727```
2828
Original file line number Diff line number Diff line change 11r"""Example for dalle demo model.
22
33To run locally with a small number of examples:
4- python -m lit_nlp.examples.dalle_demo \
5- --alsologtostderr --port=5432
4+ python -m lit_nlp.examples.dalle.demo
65
76Then navigate to localhost:5432 to access the demo UI.
87"""
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ TyDi QA Demo for the Learning Interpretability Tool
2+ =======================================================
3+
4+ This demo showcases how LIT can be used to a multilingual question-answering
5+ model trained on the [ TyDi QA dataset] ( https://doi.org/10.1162/tacl_a_00317 )
6+ using FLAX.
7+
8+ You will need a stand-alone virtual environment for the Python libraries, which you can set up using the following commands from the root of the LIT repo.
9+
10+ ``` sh
11+ # Create the virtual environment. You may want to use python3 or python3.10
12+ # depends on how many Python versions you have installed and their aliases.
13+ python -m venv .tydi-venv
14+ source .tydi-venv/bin/activate
15+ # This requirements.txt file will also install the core LIT library deps.
16+ pip install -r ./lit_nlp/examples/tydi/requirements.txt
17+ # The LIT web app still needs to be built in the usual way.
18+ (cd ./lit_nlp && yarn && yarn build)
19+ ```
20+
21+ Once your virtual environment is setup, you can launch the demo with the
22+ following command.
23+
24+ ``` sh
25+ python -m lit_nlp.examples.tydi.demo
26+ ```
Original file line number Diff line number Diff line change 11r"""Example demo loading a TyDiModel.
22
33To run locally with a small number of examples:
4- python -m lit_nlp.examples.tydi_demo \
5- --alsologtostderr --port=5432 --max_examples=10
4+ python -m lit_nlp.examples.tydi.demo
65
76Then navigate to localhost:5432 to access the demo UI.
87"""
1817from lit_nlp import server_flags
1918from lit_nlp .components import word_replacer
2019from lit_nlp .examples .datasets import question_answering
21- from lit_nlp .examples .models import tydi
20+ from lit_nlp .examples .tydi import model
2221
2322# NOTE: additional flags defined in server_flags.py
2423_FLAGS = flags .FLAGS
@@ -56,7 +55,7 @@ def main(argv: Sequence[str]) -> Optional[dev_server.LitServerType]:
5655 # Ignore path prefix, if using /path/to/<model_name> to load from a
5756 # specific directory rather than the default shortcut.
5857 model_name = os .path .basename (model_name_or_path )
59- models [model_name ] = tydi .TyDiModel (model_name = model_name_or_path )
58+ models [model_name ] = model .TyDiModel (model_name = model_name_or_path )
6059
6160 max_examples : int = _MAX_EXAMPLES .value
6261 dataset_defs : tuple [tuple [str , str ]] = (
File renamed without changes.
Original file line number Diff line number Diff line change 1+ # Copyright 2023 Google LLC
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+ # ==============================================================================
15+
16+ -r ../../../requirements_core.txt
17+
18+ jax == 0.3.16
19+ jaxlib == 0.3.15
20+ flax == 0.5.3
Original file line number Diff line number Diff line change @@ -18,7 +18,4 @@ sentencepiece==0.1.99
1818tensorflow-datasets==4.8.0
1919torch==2.0.1
2020transformers==4.27.1
21- jax==0.4.13
22- jaxlib==0.4.13
23- flax==0.6.11
2421# LINT.ThenChange(./pyproject.toml)
You can’t perform that action at this time.
0 commit comments