AriusXi commited on
Commit
50d2afb
1 Parent(s): ae4d78a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -6,12 +6,10 @@ mdl = AutoModelForCausalLM.from_pretrained("Salesforce/codegen-350M-mono")
6
 
7
  def codegen(intent):
8
  # give input as text which reflects intent of the program.
9
- text = " write a function which takes 2 numbers as input
10
- and returns the larger of the two"
11
  input_ids = codegen_tkn(intent, return_tensors="pt").input_ids
12
  gen_ids = mdl.generate(input_ids, max_length=128)
13
- response = codegen_tkn.decode(gen_ids[0], skip_special_
14
- tokens=True)
15
  return response
16
 
17
  output=grad.Textbox(lines=1, label="Generated Python Code",placeholder="")
 
6
 
7
  def codegen(intent):
8
  # give input as text which reflects intent of the program.
9
+ text = "write a function which takes 2 numbers as input and returns the larger of the two"
 
10
  input_ids = codegen_tkn(intent, return_tensors="pt").input_ids
11
  gen_ids = mdl.generate(input_ids, max_length=128)
12
+ response = codegen_tkn.decode(gen_ids[0], skip_special_tokens=True)
 
13
  return response
14
 
15
  output=grad.Textbox(lines=1, label="Generated Python Code",placeholder="")