SattwikAyyagari commited on
Commit
be1bad8
·
1 Parent(s): 3da38ba

Updated prompt for document generation with correct indentation

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -82,7 +82,8 @@ def generate_code(task_type: str, nl_input: str):
82
  return format_code(output, language="cs")
83
  elif task_type=="Generate Documentation":
84
  # prompt= f"### Instruction:\n\nGenerate documentation for the following code:\n\n{nl_input}\n\n### Response:\n\n/**"
85
- prompt = f"### Instruction:\n\nWrite a documentation comment with @param and @return tags for the following method:\n\n{nl_input}\n\n### Response:\n\n/**" output=model.generate(**inputs,max_new_tokens=200, eos_token_id=tokenizer.eos_token_id, pad_token_id=tokenizer.eos_token_id)
 
86
  response = tokenizer.decode(output[0], skip_special_tokens=True).split("### Response:\n\n")[-1].strip()
87
  if not response.startswith("/**"):
88
  response = "/**" + response
 
82
  return format_code(output, language="cs")
83
  elif task_type=="Generate Documentation":
84
  # prompt= f"### Instruction:\n\nGenerate documentation for the following code:\n\n{nl_input}\n\n### Response:\n\n/**"
85
+ prompt = f"### Instruction:\n\nWrite a documentation comment with @param and @return tags for the following method:\n\n{nl_input}\n\n### Response:\n\n/**"
86
+ output=model.generate(**inputs,max_new_tokens=200, eos_token_id=tokenizer.eos_token_id, pad_token_id=tokenizer.eos_token_id)
87
  response = tokenizer.decode(output[0], skip_special_tokens=True).split("### Response:\n\n")[-1].strip()
88
  if not response.startswith("/**"):
89
  response = "/**" + response