Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ title = "Code Explainer"
|
|
6 |
description = "This is a space to convert Python code into english text explaining what it does using [codeparrot-small-code-to-text](https://huggingface.co/codeparrot/codeparrot-small-code-to-text),\
|
7 |
a code generation model for Python finetuned on [github-jupyter-code-to-text](https://huggingface.co/datasets/codeparrot/github-jupyter-code-to-text) a dataset of Python code followed by a docstring explaining it, the data was originally extracted from Jupyter notebooks."
|
8 |
|
9 |
-
EXAMPLE_1 = "def
|
10 |
EXAMPLE_2 = "from sklearn import model_selection\nX_train, X_test, Y_train, Y_test = model_selection.train_test_split(X, Y, test_size=0.2)"
|
11 |
EXAMPLE_3 = "def load_text(file)\n with open(filename, 'r') as f:\n text = f.read()\n return text"
|
12 |
example = [
|
|
|
6 |
description = "This is a space to convert Python code into english text explaining what it does using [codeparrot-small-code-to-text](https://huggingface.co/codeparrot/codeparrot-small-code-to-text),\
|
7 |
a code generation model for Python finetuned on [github-jupyter-code-to-text](https://huggingface.co/datasets/codeparrot/github-jupyter-code-to-text) a dataset of Python code followed by a docstring explaining it, the data was originally extracted from Jupyter notebooks."
|
8 |
|
9 |
+
EXAMPLE_1 = "def sort_function(arr):\n n = len(arr)\n \n # Traverse through all array elements\n for i in range(n):\n \n # Last i elements are already in place\n for j in range(0, n-i-1):\n \n # traverse the array from 0 to n-i-1\n # Swap if the element found is greater\n # than the next element\n if arr[j] > arr[j+1]:\n arr[j], arr[j+1] = arr[j+1], arr[j]"
|
10 |
EXAMPLE_2 = "from sklearn import model_selection\nX_train, X_test, Y_train, Y_test = model_selection.train_test_split(X, Y, test_size=0.2)"
|
11 |
EXAMPLE_3 = "def load_text(file)\n with open(filename, 'r') as f:\n text = f.read()\n return text"
|
12 |
example = [
|