This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import tensorflow as tf | |
from transformers import TFGPT2LMHeadModel, GPT2Tokenizer | |
from transformers import tf_top_k_top_p_filtering | |
import panel as pn | |
pn.extension() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import panel as pn | |
import pandas as pd | |
import param | |
pn.extension(sizing_mode="stretch_width") | |
LOGO = "https://holoviz.org/assets/panel.png" | |
ACCENT_BASE_COLOR = "#4099da" | |
SELECTED_COLOR = "#2c6b98" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import holoviews as hv | |
import numpy as np | |
import panel as pn | |
pn.extension(sizing_mode="stretch_width") | |
ACCENT_COLOR = "#37718e" # "#DF3874" | |
XS = np.linspace(0, np.pi) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In order for Panel to work in VS Code you would need the jupyter_bokeh package | |
# In order for this example to work your would need `panel jupyter_bokeh altair vega_datasets ipykernel` | |
import panel as pn | |
import altair as alt | |
import vega_datasets | |
pn.extension("vega", sizing_mode="stretch_width") | |
# Lets show some interactivity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import panel as pn | |
from panel.pane.plot import Matplotlib as _MatplotlibPane | |
import param | |
import numpy as np | |
from matplotlib.figure import Figure | |
from matplotlib import cm | |
from matplotlib.backends.backend_agg import FigureCanvasAgg # not needed for mpl >= 3.1 | |
pn.extension() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install panel==0.12.4 bokeh==2.4.0 holoviews==1.14.6 hvplot==0.7.3 shapely==1.7.1 | |
# panel serve holoviz_linked_brushing.py --autoreload --show | |
import hvplot.pandas | |
import holoviews as hv | |
import panel as pn | |
from bokeh.sampledata.iris import flowers | |
pn.extension(sizing_mode="stretch_width") | |
hv.extension("bokeh") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""This module contains functionality to run a command with autoreload. | |
The command will autoreload everytime a file in the folder or it's subfolders are updated | |
Use this as for example | |
```bash | |
python autoreload panel serve *.py | |
``` |
NewerOlder