AhmedSSoliman commited on
Commit
dc0b545
·
1 Parent(s): 64f8f41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -10,9 +10,9 @@ def generate_code(NL):
10
  inputs = tokenizer([NL], padding="max_length", truncation=True, max_length=512, return_tensors="pt")
11
  input_ids = inputs.input_ids
12
  attention_mask = inputs.attention_mask
13
- outputs = new_model.generate(input_ids, attention_mask=attention_mask)
14
- # all special tokens including will be removed
15
- output_code = tokenizer.decode(outputs[0], skip_special_tokens=True)
16
  return output_code
17
 
18
 
 
10
  inputs = tokenizer([NL], padding="max_length", truncation=True, max_length=512, return_tensors="pt")
11
  input_ids = inputs.input_ids
12
  attention_mask = inputs.attention_mask
13
+ outputs = model.generate(input_ids, attention_mask=attention_mask)
14
+
15
+ output_code = tokenizer.decode(outputs, skip_special_tokens=True)
16
  return output_code
17
 
18