Spaces:
Runtime error
Runtime error
Update strings.py
Browse files- strings.py +10 -10
strings.py
CHANGED
|
@@ -1,13 +1,3 @@
|
|
| 1 |
-
def pygen_func(nl_code_intent):
|
| 2 |
-
pass # TODO: generate code PL from intent NL + search in corpus
|
| 3 |
-
# inputs = {'code_nl': code_nl}
|
| 4 |
-
# payload = json.dumps(inputs)
|
| 5 |
-
# prediction = req.request(CT5_METHOD, CT5_URL, data=payload)
|
| 6 |
-
# prediction = req.request(CT5_METHOD, CT5_URL, json=req_data)
|
| 7 |
-
# answer = json.loads(prediction.content.decode("utf-8"))
|
| 8 |
-
# return str(answer)
|
| 9 |
-
# CT5_URL = "https://api-inference.huggingface.co/models/nielsr/codet5-small-code-summarization-ruby"
|
| 10 |
-
|
| 11 |
dfs_code = r"""
|
| 12 |
def dfs(visited, graph, node): #function for dfs
|
| 13 |
if node not in visited:
|
|
@@ -149,3 +139,13 @@ For further details, see the [CodeXGLUE](https://github.com/microsoft/CodeXGLUE)
|
|
| 149 |
"""
|
| 150 |
|
| 151 |
descr_string = 'The application takes as input the python code for a function, or a class, and generates a documentation string, or code comment, for it using codeT5 fine tuned for code2text generation. Code to text generation, or code summarization, is a CodeXGLUE generation, or sequence to sequence, downstream task. CodeXGLUE stands for General Language Understanding Evaluation benchmark *for code*, which includes diversified code intelligence downstream inference tasks and datasets.'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
dfs_code = r"""
|
| 2 |
def dfs(visited, graph, node): #function for dfs
|
| 3 |
if node not in visited:
|
|
|
|
| 139 |
"""
|
| 140 |
|
| 141 |
descr_string = 'The application takes as input the python code for a function, or a class, and generates a documentation string, or code comment, for it using codeT5 fine tuned for code2text generation. Code to text generation, or code summarization, is a CodeXGLUE generation, or sequence to sequence, downstream task. CodeXGLUE stands for General Language Understanding Evaluation benchmark *for code*, which includes diversified code intelligence downstream inference tasks and datasets.'
|
| 142 |
+
|
| 143 |
+
def pygen_func(nl_code_intent):
|
| 144 |
+
pass # TODO: generate code PL from intent NL + search in corpus
|
| 145 |
+
# inputs = {'code_nl': code_nl}
|
| 146 |
+
# payload = json.dumps(inputs)
|
| 147 |
+
# prediction = req.request(CT5_METHOD, CT5_URL, data=payload)
|
| 148 |
+
# prediction = req.request(CT5_METHOD, CT5_URL, json=req_data)
|
| 149 |
+
# answer = json.loads(prediction.content.decode("utf-8"))
|
| 150 |
+
# return str(answer)
|
| 151 |
+
# CT5_URL = "https://api-inference.huggingface.co/models/nielsr/codet5-small-code-summarization-ruby"
|