out,state=model.forward([1563],state)# RNN has state (use deepcopy to clone states)
# out, state = model.forward([1563], state) # RNN has state (use deepcopy to clone states)
out,state=model.forward([310,247],state)
# out, state = model.forward([310, 247], state)
print(out.detach().cpu().numpy())# same result as above
# print(out.detach().cpu().numpy()) # same result as above
print('\n')
importipdb
ipdb.set_trace()
fromsrc.utilsimportPIPELINE,PIPELINE_ARGS
# print('\n')
pipeline=PIPELINE(model,"20B_tokenizer.json")
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(s,end='',flush=True)
# print(ctx, end='')
# For alpha_frequency and alpha_presence, see "Frequency and presence penalties":