Text Generation
Transformers
PyTorch
code
gpt2
custom_code
Eval Results
text-generation-inference
codelion commited on
Commit
11c4e7f
1 Parent(s): b943618

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -2
README.md CHANGED
@@ -92,9 +92,12 @@ checkpoint = "lambdasec/santafixer"
92
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
93
 
94
  tokenizer = AutoTokenizer.from_pretrained(checkpoint)
95
- model = AutoModelForCausalLM.from_pretrained(checkpoint, trust_remote_code=True).to(device)
 
96
 
97
- input_text = "<fim-prefix>def print_hello_world():\n <fim-suffix>\n print('Hello world!')<fim-middle>"
 
 
98
  inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
99
  outputs = model.generate(inputs)
100
  print(tokenizer.decode(outputs[0]))
 
92
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
93
 
94
  tokenizer = AutoTokenizer.from_pretrained(checkpoint)
95
+ model = AutoModelForCausalLM.from_pretrained(checkpoint,
96
+ trust_remote_code=True).to(device)
97
 
98
+ input_text = "<fim-prefix>def print_hello_world():\n
99
+ <fim-suffix>\n print('Hello world!')
100
+ <fim-middle>"
101
  inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
102
  outputs = model.generate(inputs)
103
  print(tokenizer.decode(outputs[0]))