start new:
tmux
start new with session name:
tmux new -s myname
def top_k_top_p_filtering(logits, top_k=0, top_p=0.0, filter_value=-float('Inf')): | |
""" Filter a distribution of logits using top-k and/or nucleus (top-p) filtering | |
Args: | |
logits: logits distribution shape (vocabulary size) | |
top_k >0: keep only top k tokens with highest probability (top-k filtering). | |
top_p >0.0: keep the top tokens with cumulative probability >= top_p (nucleus filtering). | |
Nucleus filtering is described in Holtzman et al. (http://arxiv.org/abs/1904.09751) | |
""" | |
assert logits.dim() == 1 # batch size 1 for now - could be updated for more but the code would be less clear | |
top_k = min(top_k, logits.size(-1)) # Safety check |
#!/bin/bash | |
LC_ALL=en_US.UTF-8 | |
# configures/installs common CHIP features (including enabling disabled ones) | |
# run 'sudo chmod +x setup.sh && ./setup.sh' to run the installation | |
clear | |
res= | |
dtc= | |
rboot= | |
uname -a | |
cat << _EOF_ |