Update app.py
Browse files
app.py
CHANGED
@@ -1,27 +1,19 @@
|
|
1 |
import gradio as gr
|
2 |
-
from binoculars import Binoculars
|
3 |
-
|
4 |
-
BINO = Binoculars()
|
5 |
-
TOKENIZER = BINO.tokenizer
|
6 |
-
MINIMUM_TOKENS = 64
|
7 |
|
8 |
|
9 |
def count_tokens(text):
|
10 |
-
return
|
|
|
11 |
|
12 |
|
13 |
def run_detector(input_str):
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
return
|
|
|
18 |
|
19 |
|
20 |
-
# def load_set(progress=gr.Progress()):
|
21 |
-
# tokens = [None] * 24
|
22 |
-
# for count in progress.tqdm(tokens, desc="Counting Tokens..."):
|
23 |
-
# time.sleep(0.01)
|
24 |
-
# return ["Loaded"] * 2
|
25 |
|
26 |
|
27 |
css = """
|
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
|
4 |
def count_tokens(text):
|
5 |
+
return 0
|
6 |
+
# return len(TOKENIZER(text).input_ids)
|
7 |
|
8 |
|
9 |
def run_detector(input_str):
|
10 |
+
return 1
|
11 |
+
# if count_tokens(input_str) < MINIMUM_TOKENS:
|
12 |
+
# gr.Warning(f"Too short length. Need minimum {MINIMUM_TOKENS} tokens to run Binoculars.")
|
13 |
+
# return ""
|
14 |
+
# return f"{BINO.predict(input_str)}"
|
15 |
|
16 |
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
|
19 |
css = """
|