Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to extract the Visualization module as an independent python packages? #40

Closed
Dounm opened this issue Nov 1, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Dounm
Copy link

Dounm commented Nov 1, 2022

Visualization(mode).structure_graph() is especially useful to view the large language models, and sometimes I would like to use it in some other scenario.

So instead of install the whole OpenDelta, is it possible to isolate the Visualization functionality from OpenDelta, then it can become more light-weight and more easily to install ?

@ShengdingHu
Copy link
Collaborator

Thanks for you suggestion. I will prepare it soon.

@ShengdingHu ShengdingHu added the enhancement New feature or request label Nov 6, 2022
@zt-wang19
Copy link
Collaborator

@Dounm We've solved the issue in this commit:
https://github.com/thunlp/OpenDelta/tree/ecbfc0f2449586db41f01cb69f3f080fb3e1a474
And we've also upload the visualization module to PyPI. You can first pip install bigmodelvis, and then use the code below to visualize your model:

from bigmodelvis import Visualization
from transformers import BertForMaskedLM
model = BertForMaskedLM.from_pretrained('bert-base-uncased')
visobj = Visualization(model)
visobj.structure_graph()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants