stmnk commited on
Commit
a5ef20b
·
1 Parent(s): 3af797d

add output condition

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -114,7 +114,10 @@ real_docstring = r"""
114
  def docgen_func(function_code):
115
  req_data = {"inputs": function_code}
116
  output = query(req_data)
117
- return f'"""\n{output[0]["generated_text"]}\n"""'
 
 
 
118
 
119
  def pygen_func(nl_code_intent):
120
  pass # TODO: generate code PL from intent NL + search in corpus
 
114
  def docgen_func(function_code):
115
  req_data = {"inputs": function_code}
116
  output = query(req_data)
117
+ if type(output) is list:
118
+ return f'"""\n{output[0]["generated_text"]}\n"""'
119
+ else:
120
+ return str(output)
121
 
122
  def pygen_func(nl_code_intent):
123
  pass # TODO: generate code PL from intent NL + search in corpus