Spaces:
Runtime error
Runtime error
Commit
·
dc0b545
1
Parent(s):
64f8f41
Update app.py
Browse files
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 =
|
14 |
-
|
15 |
-
output_code = tokenizer.decode(outputs
|
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 |
|