You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After trying to run it fails
`def extract_hidden_states(batch):
# Place model inputs on the GPU
inputs = {k:v.to(device) for k,v in batch.items()
if k in tokenizer.model_input_names}
# Extract last hidden states
with torch.no_grad():
last_hidden_state = model(**inputs).last_hidden_state
# Return vector for [CLS] token
return {"hidden_state": last_hidden_state[:,0].cpu().numpy()}
emotions_hidden = emotions_encoded.map(extract_hidden_states, batched=True)
`
I tried on my machine and also on colab, and both seem to have the same error, I tried to modified the setup, but for some reason I cannot change the numpy library to an older version, I don't know someone has the same error
To Reproduce
Steps to reproduce the behavior:
Run the cell emotions_hidden = emotions_encoded.map(extract_hidden_states, batched=True)
the error module 'numpy' has no attribute 'object'. np.object was a deprecated alias for the builtin object. To avoid this error in existing code, use object by itself. Doing this will not modify any behavior and is safe.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
Expected behavior
Run the cell as expected an preprocess all the dataset
The text was updated successfully, but these errors were encountered:
Information
The problem arises in chapter:
Describe the bug
After trying to run it fails
`def extract_hidden_states(batch):
# Place model inputs on the GPU
inputs = {k:v.to(device) for k,v in batch.items()
if k in tokenizer.model_input_names}
# Extract last hidden states
with torch.no_grad():
last_hidden_state = model(**inputs).last_hidden_state
# Return vector for [CLS] token
return {"hidden_state": last_hidden_state[:,0].cpu().numpy()}
emotions_hidden = emotions_encoded.map(extract_hidden_states, batched=True)
`
I tried on my machine and also on colab, and both seem to have the same error, I tried to modified the setup, but for some reason I cannot change the numpy library to an older version, I don't know someone has the same error
To Reproduce
Steps to reproduce the behavior:
the error module 'numpy' has no attribute 'object'.
np.object
was a deprecated alias for the builtinobject
. To avoid this error in existing code, useobject
by itself. Doing this will not modify any behavior and is safe.The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
Expected behavior
Run the cell as expected an preprocess all the dataset
The text was updated successfully, but these errors were encountered: