Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
fbd8874
Update keras import to fix build error.
sampathweb Apr 19, 2024
483082d
LIT: Refactor DataService reactions.
RyanMullins Apr 26, 2024
a5265a4
LIT: Add warm_start option to LitWidget
RyanMullins Apr 26, 2024
4fb3bde
Pretty-printing of Model objects
iftenney May 1, 2024
675ca2d
Add the helper function in Keras setup to clean up special tokens in …
bdu91 May 10, 2024
b16059f
Rename lm_salience_module to sequence_salience_module
RyanMullins May 22, 2024
b3c120b
LIT: Relax min Python version to 3.9
RyanMullins May 24, 2024
5188c8c
Relaxing SHAP version.
RyanMullins May 29, 2024
15eccb1
Simplify file_cache logic and re-enable for sequence salience demo.
iftenney May 30, 2024
f4c0990
No public description
a-googler Jun 3, 2024
6aa2eb6
Remove the image demo, models, dataset, and other related documentati…
llcourage Jun 4, 2024
c2fb41b
Remove the toxicity demos from the LIT examples.
llcourage Jun 5, 2024
dd196e9
Remove the xnli demos from the LIT examples.
llcourage Jun 5, 2024
72fd772
Remove the is_eval_demo from the LIT examples.
llcourage Jun 6, 2024
71d88fb
Remove the coref demo from the LIT examples.
llcourage Jun 6, 2024
aa49340
Remove the t5 demo, models, dataset, and other related documentation …
llcourage Jun 7, 2024
08289df
LIT: Improved packaging for prompt debugging code.
RyanMullins Jun 7, 2024
fc7b0d0
Move the glue demo to a self-contained directory.
llcourage Jun 10, 2024
2475b3b
LIT: Remove legacy Language Model demo.
RyanMullins Jun 12, 2024
a59641c
LIT: Move TyDI data into examples/tydi
RyanMullins Jun 12, 2024
0d8c0d9
LIT: Avoid equivalent shuffles in Scrambler
RyanMullins Jun 12, 2024
1ed82d4
LIT: Remove TFX model wrapper.
RyanMullins Jun 13, 2024
7d5ef58
LIT: Move model_utils to glue demo directory.
RyanMullins Jun 13, 2024
992823b
Minor updates on the model support in doc string post demo cleanup.
bdu91 Jun 17, 2024
3dad2b0
Remove LM prediction module.
llcourage Jun 18, 2024
0656386
Remove span graph module from LIT.
llcourage Jun 18, 2024
27d7a84
Remove attention module from LIT.
llcourage Jun 20, 2024
8863019
Fix import in TyDi model.
llcourage Jun 21, 2024
afd51fe
Update code links in LIT documentation to point to new demo locations.
llcourage Jun 21, 2024
e0e35c3
Fix a bug in the prompt debugging demo.
llcourage Jun 21, 2024
71cbdba
Fix for Remove attention module from LIT. Removed AttentionModule fro…
a-googler Jun 24, 2024
416d573
Remove the DALL-E demo from LIT. The package dependency could not be…
llcourage Jun 24, 2024
bcc481e
Update requirements.txt files for penguin demo, glue demo, and tydi d…
llcourage Jun 24, 2024
bb29f43
Add Jinja2 to penguin requirements.txt.
llcourage Jun 25, 2024
c7970fb
Update prompt_examples.jsonl path in MANIFEST.in.
llcourage Jun 25, 2024
7dda659
Internal change
RyanMullins Jun 25, 2024
79ada6e
LIT documentation update post demo cleanup.
bdu91 Jun 25, 2024
b14e3b1
Updated gunicorn config for demos running in Docker.
RyanMullins Jun 25, 2024
7ff377f
LIT: Disable embeddings for TyDi.
RyanMullins Jun 25, 2024
5639e3b
Update requirements.txt for TyDi example.
llcourage Jun 25, 2024
1c8d6a0
Update LIT documentation to reflect path changes in the codebase and …
cpka145 Jun 25, 2024
cee3b58
Fix typo in example command.
llcourage Jun 25, 2024
48b029c
Update colab examples to include installation of the lit-nlp package.
cpka145 Jun 25, 2024
2e9d267
More LIT documentation updates.
bdu91 Jun 25, 2024
5456011
Cast embeddings to float32 before computing distances.
llcourage Jun 25, 2024
998ed15
Website updates for v1.2 release
RyanMullins Jun 26, 2024
cba3188
Merge pull request #1524 from PAIR-code/website-1-2
bdu91 Jun 26, 2024
57c3ca3
LIT 1.2 release notes.
bdu91 Jun 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Pretty-printing of Model objects
PiperOrigin-RevId: 629571604
  • Loading branch information
iftenney authored and LIT team committed May 1, 2024
commit 4fb3bde897c68fdeb3bd829f6e5a88223bc131a4
12 changes: 12 additions & 0 deletions lit_nlp/api/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ def description(self) -> str:
"""
return inspect.getdoc(self) or ''

def __str__(self) -> str:
classname = self.__class__.__module__ + '.' + self.__class__.__qualname__
indented_description = ' ' + self.description().replace('\n', '\n ')
return f'{classname}(...):\n{indented_description}'

def _repr_pretty_(self, p, cycle):
"""Pretty-printing for IPython environments, both notebooks and repl."""
if not cycle:
p.text(str(self))
else:
p.text('...')

@classmethod
def init_spec(cls) -> Optional[Spec]:
"""Attempts to infer a Spec describing a Model's constructor parameters.
Expand Down