Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,38 +16,6 @@ demo = gr.Interface(fn=greet, inputs='text', outputs="text")
|
|
| 16 |
demo.launch()
|
| 17 |
"""
|
| 18 |
|
| 19 |
-
def diff_texts(text1, text2):
|
| 20 |
-
d = Differ()
|
| 21 |
-
return [
|
| 22 |
-
(token[2:], token[0] if token[0] != " " else None)
|
| 23 |
-
for token in d.compare(text1, text2)
|
| 24 |
-
]
|
| 25 |
-
|
| 26 |
-
demo = gr.Interface(
|
| 27 |
-
diff_texts,
|
| 28 |
-
[
|
| 29 |
-
gr.Textbox(
|
| 30 |
-
label="Text 1",
|
| 31 |
-
info="Initial text",
|
| 32 |
-
lines=3,
|
| 33 |
-
value="The quick brown fox jumped over the lazy dogs.",
|
| 34 |
-
),
|
| 35 |
-
gr.Textbox(
|
| 36 |
-
label="Text 2",
|
| 37 |
-
info="Text to compare",
|
| 38 |
-
lines=3,
|
| 39 |
-
value="The fast brown fox jumps over lazy dogs.",
|
| 40 |
-
),
|
| 41 |
-
],
|
| 42 |
-
gr.HighlightedText(
|
| 43 |
-
label="Diff",
|
| 44 |
-
combine_adjacent=True,
|
| 45 |
-
show_legend=True,
|
| 46 |
-
color_map={"+": "red", "-": "green"}),
|
| 47 |
-
theme=gr.themes.Base()
|
| 48 |
-
)
|
| 49 |
-
if __name__ == "__main__":
|
| 50 |
-
demo.launch()
|
| 51 |
|
| 52 |
import gradio as gr
|
| 53 |
import json
|
|
@@ -2662,7 +2630,7 @@ with gr.Blocks(theme=gr.themes.Monochrome(), js=js_func) as demo:
|
|
| 2662 |
|
| 2663 |
|
| 2664 |
|
| 2665 |
-
|
| 2666 |
#bron: https://www.youtube.com/watch?v=q2XVtWfancQ
|
| 2667 |
#https://www.youtube.com/watch?v=144uOfr4SYA
|
| 2668 |
#boing: https://www.youtube.com/watch?v=y5NTNC7h-Mg
|
|
|
|
| 16 |
demo.launch()
|
| 17 |
"""
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
import gradio as gr
|
| 21 |
import json
|
|
|
|
| 2630 |
|
| 2631 |
|
| 2632 |
|
| 2633 |
+
demo.launch()
|
| 2634 |
#bron: https://www.youtube.com/watch?v=q2XVtWfancQ
|
| 2635 |
#https://www.youtube.com/watch?v=144uOfr4SYA
|
| 2636 |
#boing: https://www.youtube.com/watch?v=y5NTNC7h-Mg
|