Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -13,8 +13,8 @@ example = [
|
|
13 |
['import java.util.*;\n\npublic class ehab4 {\n public static void main( String[] args ) {\n Scanner in = new Scanner( System.in );\n\tint a = 0, b = 0;\n\tSystem.out.println( "? 0 0 " );\n\tSystem.out.flush();\n\tint c = in.nextInt();\n\tfor ( int i = 29; i >= 0; i-- ) {\n\t System.out.println( "? " + ( a + ( 1 << i ) ) + " " + b );\n\t System.out.flush();\n\t int q1 = in.nextInt();\n\t System.out.println( "? " + a + " " + ( b + ( 1 << i ) ) );\n\t System.out.flush();\n\t int q2 = in.nextInt();\n\t if ( q1 == q2 ) {\n\t\tif ( c == 1 )\n\t\t a += ( 1 << i );\n\t\telse if ( c == -1 )\n\t\t b += ( 1 << i );\n\t\tc = q1;\n\t }\n\t else if ( q1 == -1 ) {\n\t\ta += ( 1 << i );\n\t\tb += ( 1 << i );\n\t }\n\t else if ( q1 == -2 )\n\t\treturn;\n\t}\n\tSystem.out.println( "! " + a + " " + b );\n\tSystem.out.flush();\n }\n}\n']]
|
14 |
|
15 |
# model to be changed to the finetuned one
|
16 |
-
tokenizer = AutoTokenizer.from_pretrained("codeparrot/
|
17 |
-
model = AutoModelForSequenceClassification.from_pretrained("codeparrot/
|
18 |
|
19 |
def get_label(output):
|
20 |
label = int(output[-1])
|
|
|
13 |
['import java.util.*;\n\npublic class ehab4 {\n public static void main( String[] args ) {\n Scanner in = new Scanner( System.in );\n\tint a = 0, b = 0;\n\tSystem.out.println( "? 0 0 " );\n\tSystem.out.flush();\n\tint c = in.nextInt();\n\tfor ( int i = 29; i >= 0; i-- ) {\n\t System.out.println( "? " + ( a + ( 1 << i ) ) + " " + b );\n\t System.out.flush();\n\t int q1 = in.nextInt();\n\t System.out.println( "? " + a + " " + ( b + ( 1 << i ) ) );\n\t System.out.flush();\n\t int q2 = in.nextInt();\n\t if ( q1 == q2 ) {\n\t\tif ( c == 1 )\n\t\t a += ( 1 << i );\n\t\telse if ( c == -1 )\n\t\t b += ( 1 << i );\n\t\tc = q1;\n\t }\n\t else if ( q1 == -1 ) {\n\t\ta += ( 1 << i );\n\t\tb += ( 1 << i );\n\t }\n\t else if ( q1 == -2 )\n\t\treturn;\n\t}\n\tSystem.out.println( "! " + a + " " + b );\n\tSystem.out.flush();\n }\n}\n']]
|
14 |
|
15 |
# model to be changed to the finetuned one
|
16 |
+
tokenizer = AutoTokenizer.from_pretrained("codeparrot/unixcoder-java-complexity-prediction")
|
17 |
+
model = AutoModelForSequenceClassification.from_pretrained("codeparrot/unixcoder-java-complexity-prediction", num_labels=7)
|
18 |
|
19 |
def get_label(output):
|
20 |
label = int(output[-1])
|