Skip to content

Commit 9e991a7

Browse files
committed
improve error handling for missing hugging-face libraries
1 parent d5e4b4e commit 9e991a7

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors:
55
given-names: "Jeremy"
66
orcid: "https://orcid.org/0000-0001-7613-4732"
77
title: "DataWrangler: wrangler your messy data into consistent well-organized formats"
8-
version: 0.2.1
8+
version: 0.2.2
99
doi: 10.5281/zenodo.5123310
1010
date-released: 2022-07-25
1111
url: "https://github.com/ContextLab/data-wrangler"

HISTORY.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
History
33
=======
44

5+
0.2.2 (22-07-25)
6+
-----------------
7+
8+
* Better error handling when hugging-face libraries aren't installed and user asks to embed text using hugging-face models
9+
10+
0.2.1 (22-07-25)
11+
------------------
12+
13+
* Bug fixes when hugging-face libraries aren't installed
14+
515
0.2.0 (2022-07-25)
616
------------------
717

datawrangler/zoo/text.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ def model_lookup(model_name, parent):
124124
return eval(f'{parent}.{model_name}')
125125
except AttributeError:
126126
return None
127+
except NameError:
128+
raise ModuleNotFoundError('Hugging-face libraries have not been installed. To use hugging-face models, please run "pip install --upgrade pydata-wrangler[hf]" to fix.')
129+
127130

128131
for p in ['text', 'decomposition', 'embeddings']:
129132
m = model_lookup(x, p)

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.2.1
2+
current_version = 0.2.2
33
commit = True
44
tag = True
55

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@
4646
test_suite='tests',
4747
tests_require=test_requirements,
4848
url='https://github.com/ContextLab/data-wrangler',
49-
version='0.2.1',
49+
version='0.2.2',
5050
zip_safe=False,
5151
)

0 commit comments

Comments
 (0)