PAIR-code / lit

The Learning Interpretability Tool: Interactively analyze ML models to understand their behavior in an extensible and framework agnostic interface.
https://pair-code.github.io/lit
Apache License 2.0
3.45k stars 351 forks source link

Widget on Google Cloud Vertex AI Workbench Notebook #1463

Closed toki-debug closed 2 months ago

toki-debug commented 3 months ago

Hi! I would like to use a widget for Google Cloud Vertex AI Notebook, but I'm a little confused about how to do it properly. I tried to search in the documentation, but I'm not entirely sure about how to do it.

image

bdu91 commented 3 months ago

Hello, can you elaborate a bit about how you set up the notebook? I don't know the if proxy_url is causing the problem here and maybe try removing it?

Since you mentioned Google Cloud Vertex AI notebook, this is the path I tried:

  1. Vertex AI notebook website, click "Go to Console"
  2. this bring me to the Google Cloud Colab Enterprise page and I opened one of the "intro_gemini_pro_python.ipynb" notebooks (any notebook should work or create a new one)
  3. I then connected to a default Vertex AI runtime, pip installed LIT there and tried one of our examples (basically copied the code into the notebook opened at step 2 and used a GPT2 model instead of Gemma since the runtime at step 2 is CPU) and was able to load the widget.
toki-debug commented 3 months ago

Hello! :) I'm currently using Vertex AI Workbench. I've gained access to a project machine and am utilizing JupyterLab notebooks there. I would like to know if it's possible to use widgets there. When running just with the port, it displays the same page as shown with the proxy.

image

bdu91 commented 3 months ago

Hello, I am relatively new to Vertex AI Workbench, but I also tried to render LIT widget and it seems to work fine, here is the process I went through:

Let me know if there is anything different you've done that could cause the issue. VertexAI_workbench_LIT

toki-debug commented 3 months ago

I see, so it might be a problem with my version. I'm currently working with lit-nlp Version 0.5.0, as I need to use Python 3.9 to run my models :/

RyanMullins commented 3 months ago

I might be able to relax the Python version requirements to include 3.9... I'll investigate and get back to you later this week or early next.

Out of curiosity, which modeling framework are you using that requires Py3.9?

toki-debug commented 3 months ago

Oh, thanks, that would be very helpful! :) The model pipeline doesn't actually require Python 3.9, but there are some important dependencies from where I get the model trained that needs this version.

toki-debug commented 3 months ago

Hey, @RyanMullins! Just checking in, any updates on it?

RyanMullins commented 3 months ago

Sorry, had to deal with some other tasks this week. Planning to look at this tomorrow (Fri 24 May 2024) and give you and update. We don't use many Py3.10+ features, though I know we use strict=True on a few zip() calls that will need to be reverted. Hopefully it's not much more complicated than that.

toki-debug commented 3 months ago

I completely understand that other tasks can take priority and I sincerely appreciate your efforts on this matter! Looking forward to your update tomorrow. Thanks for your efforts on this! :)

RyanMullins commented 3 months ago

@toki-debug the PR above addresses the Python 3.9 compatibility issues (thankfully they were all minor). We aren't planning a formal release for about another month, so you'll need to install the dev branch via git in the meantime.

pip install git+https://github.com/PAIR-code/lit.git@dev
toki-debug commented 3 months ago

Thank you so much, @RyanMullins! I will test it as soon as possible and let you know if everything is working as it should. Thanks again for being so attentive and fast; I really appreciate your efforts! 😄

toki-debug commented 2 months ago

Everything seems to be working completely fine, thanks again!!