New feature! You can now globally trace some Python builtin classes irrespective of the context you are in.
Here is the list of supported builtins:
bool
bytes
int
float
str
complex
bytearray
tuple
list
set
dict
Here is how you can use it:
import nnsight
from nnsight import LanguageModel
model = LanguageModel("openai-community/gpt2", device_map=True)
with model.session() as session:
nn_list = nnsight.list().save()
with session.iter([0, 1, 2]) as item:
nn_list.append(nnsight.int(item))
print("List: ", nn_list)
import nnsight
from nnsight import LanguageModel
model = LanguageModel("openai-community/gpt2, device_map=True)
with model.session() as session:
nn_list = nnsight.list()
with session.iter([0, 1, 2]) as item:
nn_list.append(nnsight.int(item))
print("List: ", nn_list)
New feature! You can now globally trace some Python builtin classes irrespective of the context you are in.
Here is the list of supported builtins:
Here is how you can use it: