a0ms1n commited on
Commit
cab4e24
·
verified ·
1 Parent(s): cf02fb2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -15,6 +15,8 @@ def load_cpp_file(file):
15
  return ""
16
 
17
  def Evaluate_Code(code, method):
 
 
18
  choices=["V.1.1 (No Format)", "V.1.2 (Format Code)", "Combine"]
19
  if method == choices[0]:
20
  return Evaluate1.eval(code)
@@ -29,7 +31,7 @@ def Evaluate_Code(code, method):
29
  label = "AI" if avg_conf > 50.0 else "Human"
30
  return label, f"{avg_conf:.2f} %"
31
  else:
32
- return "Invalid method", "0.00 %"
33
 
34
  with gr.Blocks() as web:
35
  with gr.Row():
 
15
  return ""
16
 
17
  def Evaluate_Code(code, method):
18
+ if len(code) >= 1500000:
19
+ return "Your code is too large", "-"
20
  choices=["V.1.1 (No Format)", "V.1.2 (Format Code)", "Combine"]
21
  if method == choices[0]:
22
  return Evaluate1.eval(code)
 
31
  label = "AI" if avg_conf > 50.0 else "Human"
32
  return label, f"{avg_conf:.2f} %"
33
  else:
34
+ return "Invalid method", "-"
35
 
36
  with gr.Blocks() as web:
37
  with gr.Row():