Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- .app.py.swp +0 -0
- __pycache__/app.cpython-312.pyc +0 -0
- app.py +5 -4
.app.py.swp
CHANGED
Binary files a/.app.py.swp and b/.app.py.swp differ
|
|
__pycache__/app.cpython-312.pyc
CHANGED
Binary files a/__pycache__/app.cpython-312.pyc and b/__pycache__/app.cpython-312.pyc differ
|
|
app.py
CHANGED
@@ -20,8 +20,8 @@ def diff_texts(text1, text2):
|
|
20 |
lst1 = input1 or split(text1)
|
21 |
lst2 = input2 or split(text2)
|
22 |
|
23 |
-
diff1 = convert(diff(lst1, lst2), '
|
24 |
-
diff2 = convert(diff(lst2, lst1), '
|
25 |
intrs = convert(inters(lst1, lst2), None)
|
26 |
|
27 |
return diff1 + diff2 + intrs
|
@@ -47,8 +47,9 @@ demo = gr.Interface(
|
|
47 |
label="Diff",
|
48 |
combine_adjacent=True,
|
49 |
adjacent_separator=", ",
|
50 |
-
show_legend=
|
51 |
-
color_map={"
|
|
|
52 |
theme=gr.themes.Base()
|
53 |
)
|
54 |
|
|
|
20 |
lst1 = input1 or split(text1)
|
21 |
lst2 = input2 or split(text2)
|
22 |
|
23 |
+
diff1 = convert(diff(lst1, lst2), '-')
|
24 |
+
diff2 = convert(diff(lst2, lst1), '+')
|
25 |
intrs = convert(inters(lst1, lst2), None)
|
26 |
|
27 |
return diff1 + diff2 + intrs
|
|
|
47 |
label="Diff",
|
48 |
combine_adjacent=True,
|
49 |
adjacent_separator=", ",
|
50 |
+
show_legend=True,
|
51 |
+
color_map={"-": "red", "+": "green"}
|
52 |
+
),
|
53 |
theme=gr.themes.Base()
|
54 |
)
|
55 |
|