Update README.md
Browse files
README.md
CHANGED
@@ -6,13 +6,18 @@ language:
|
|
6 |
- en
|
7 |
widget:
|
8 |
- text: >
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
16 |
datasets:
|
17 |
- sagard21/autotrain-data-code-explainer
|
18 |
co2_eq_emissions:
|
@@ -41,7 +46,7 @@ from transformers import (
|
|
41 |
pipeline,
|
42 |
)
|
43 |
|
44 |
-
model_name = "
|
45 |
|
46 |
tokenizer = AutoTokenizer.from_pretrained(model_name, padding=True)
|
47 |
|
|
|
6 |
- en
|
7 |
widget:
|
8 |
- text: >
|
9 |
+
class Solution(object):
|
10 |
+
def isValid(self, s):
|
11 |
+
stack = []
|
12 |
+
mapping = {")": "(", "}": "{", "]": "["}
|
13 |
+
for char in s:
|
14 |
+
if char in mapping:
|
15 |
+
top_element = stack.pop() if stack else '#'
|
16 |
+
if mapping[char] != top_element:
|
17 |
+
return False
|
18 |
+
else:
|
19 |
+
stack.append(char)
|
20 |
+
return not stack
|
21 |
datasets:
|
22 |
- sagard21/autotrain-data-code-explainer
|
23 |
co2_eq_emissions:
|
|
|
46 |
pipeline,
|
47 |
)
|
48 |
|
49 |
+
model_name = "ashwinR/CodeExplainer"
|
50 |
|
51 |
tokenizer = AutoTokenizer.from_pretrained(model_name, padding=True)
|
52 |
|