stmnk commited on
Commit
7a62924
·
1 Parent(s): 7f8afa2

add task py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -39,6 +39,8 @@ def fetch_archive_from_http(url: str, output_dir: str, proxies: Optional[dict] =
39
  return True
40
  """
41
 
 
 
42
  real_docstring = r"""
43
  Fetch an archive (zip or tar.gz) from a url via http and extract content to an output directory.
44
 
@@ -49,7 +51,7 @@ real_docstring = r"""
49
  """
50
 
51
  def pygen_func(function_code):
52
- req_data = {"inputs": function_code}
53
  output = query(req_data)
54
  return str(output)
55
 
@@ -62,7 +64,10 @@ def pygen_func(function_code):
62
 
63
  iface = gr.Interface(pygen_func,
64
  [
65
- gr.inputs.Textbox(lines=7, label="Code Intent NL", default=function_code),
66
- ],
67
- gr.outputs.Textbox(label="Code Generated PL"))
 
 
 
68
  iface.launch(share=True)
 
39
  return True
40
  """
41
 
42
+ task_code = f'Summarize Python: {function_code}'
43
+
44
  real_docstring = r"""
45
  Fetch an archive (zip or tar.gz) from a url via http and extract content to an output directory.
46
 
 
51
  """
52
 
53
  def pygen_func(function_code):
54
+ req_data = {"inputs": task_code}
55
  output = query(req_data)
56
  return str(output)
57
 
 
64
 
65
  iface = gr.Interface(pygen_func,
66
  [
67
+ # gr.inputs.Textbox(lines=7, label="Code Intent (NL)", default=task_code),
68
+ gr.inputs.Textbox(lines=7, label="Task + Code (PL)", default=task_code),
69
+ ],
70
+ # gr.outputs.Textbox(label="Code Generated PL"))
71
+ gr.outputs.Textbox(label="Docstring Generated (NL)"))
72
+
73
  iface.launch(share=True)