Spaces:
Runtime error
Runtime error
add output condition
Browse files
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 |
-
|
|
|
|
|
|
|
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
|