Spaces:
Runtime error
Runtime error
Commit
·
55056ca
1
Parent(s):
ffb0217
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ tokenizer = AutoTokenizer.from_pretrained("AhmedSSoliman/MarianCG_NL-to-Code")
|
|
7 |
model = AutoModelForSeq2SeqLM.from_pretrained("AhmedSSoliman/MarianCG_NL-to-Code")
|
8 |
|
9 |
def generate_code(NL):
|
10 |
-
inputs = tokenizer(
|
11 |
input_ids = inputs.input_ids
|
12 |
attention_mask = inputs.attention_mask
|
13 |
outputs = model.generate(input_ids, attention_mask=attention_mask)
|
|
|
7 |
model = AutoModelForSeq2SeqLM.from_pretrained("AhmedSSoliman/MarianCG_NL-to-Code")
|
8 |
|
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 = model.generate(input_ids, attention_mask=attention_mask)
|