mrm8488 commited on
Commit
8994507
1 Parent(s): d87f4e9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -3
README.md CHANGED
@@ -65,12 +65,14 @@ import torch
65
 
66
  from Utils import GPTJBlock, GPTJForCausalLM
67
 
68
- device = 'cuda' if torch.cuda.is_available() else 'cpu'
69
 
70
  transformers.models.gptj.modeling_gptj.GPTJBlock = GPTJBlock # monkey-patch GPT-J
71
 
72
- tokenizer = transformers.AutoTokenizer.from_pretrained("mrm8488/bertin-gpt-j-6B-ES-8bit")
73
- model = GPTJForCausalLM.from_pretrained("hivemind/gpt-j-6B-8bit", pad_token_id=tokenizer.eos_token_id, low_cpu_mem_usage=True).to(device)
 
 
74
 
75
 
76
  prompt = tokenizer("El sentido de la vida es", return_tensors='pt')
 
65
 
66
  from Utils import GPTJBlock, GPTJForCausalLM
67
 
68
+ device = "cuda" if torch.cuda.is_available() else "cpu"
69
 
70
  transformers.models.gptj.modeling_gptj.GPTJBlock = GPTJBlock # monkey-patch GPT-J
71
 
72
+ ckpt = "mrm8488/bertin-gpt-j-6B-ES-8bit"
73
+
74
+ tokenizer = transformers.AutoTokenizer.from_pretrained(ckpt)
75
+ model = GPTJForCausalLM.from_pretrained(ckpt, pad_token_id=tokenizer.eos_token_id, low_cpu_mem_usage=True).to(device)
76
 
77
 
78
  prompt = tokenizer("El sentido de la vida es", return_tensors='pt')