out,state=model.forward([1563],state)# RNN has state (use deepcopy to clone states)
out,state=model.forward([310,247],state)
print(out.detach().cpu().numpy())# same result as above
# out, state = model.forward([187, 510], None)
# out, state = model.forward([1563], state) # RNN has state (use deepcopy to clone states)
# out, state = model.forward([310, 247], state)
# print(out.detach().cpu().numpy()) # same result as above
print('\n')
importipdb
ipdb.set_trace()
fromsrc.utilsimportPIPELINE,PIPELINE_ARGS
pipeline=PIPELINE(model,"20B_tokenizer.json")
# print('\n')
ctx="\nIn a shocking finding, scientist discovered a herd of dragons living in a remote, previously unexplored valley, in Tibet. Even more surprising to the researchers was the fact that the dragons spoke perfect Chinese."
# ctx = "\nIn a shocking finding, scientist discovered a herd of dragons living in a remote, previously unexplored valley, in Tibet. Even more surprising to the researchers was the fact that the dragons spoke perfect Chinese."
# print(ctx, end='')
# For alpha_frequency and alpha_presence, see "Frequency and presence penalties":