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
%pipinstallipywidgets# Import IPython widgets for interactive inputfromIPython.displayimportdisplayimportipywidgetsaswidgets# Create a text box for user inputprompt_box=widgets.Textarea(
value='Enter your prompt here...',
placeholder='Type something...',
description='Prompt:',
disabled=False
)
# Create a button to generate textbutton=widgets.Button(description="Generate Text")
# Function to handle button clickdefon_button_click(b):
prompt=prompt_box.valuegenerated_text="generate_text(prompt)"print("Prompt:", prompt)
print("Generated Text:", generated_text)
# Attach the function to the button click eventbutton.on_click(on_button_click)
# Display the text box and buttondisplay(prompt_box, button)
Hello. I have been facing this same problem. I noticed the kernel responds to the first few interactions but then stops responding. Did you find a solution or a possible cause?
For the following simple ipywidgets code:
I works well in other Jupyter environment, such as Colab (https://colab.research.google.com/).
But the button clicking does not show anything in Jupyterlite, such as here (https://jupyterlite-pyodide-kernel.readthedocs.io/en/latest/_static/lab/index.html).
Please check.
Thanks,
The text was updated successfully, but these errors were encountered: