Spaces:
Build error
Build error
freemt
commited on
Commit
·
899f8ea
1
Parent(s):
312ea97
Fix gr.HTML outputs
Browse files- ubee/__main__.py +10 -11
ubee/__main__.py
CHANGED
@@ -79,17 +79,13 @@ except Exception as _:
|
|
79 |
# 'scores': [0.8885253667831421, 0.10581762343645096, 0.005657028406858444]}
|
80 |
# Runs OK
|
81 |
|
82 |
-
# text1 = ""
|
83 |
-
# text2 = ""
|
84 |
-
# thresh: float = 0.4
|
85 |
-
|
86 |
|
87 |
# segment: str
|
88 |
def ifn(
|
89 |
text1,
|
90 |
text2,
|
91 |
thresh
|
92 |
-
)
|
93 |
"""Take inputs, return outputs.
|
94 |
|
95 |
Args:
|
@@ -188,12 +184,12 @@ def main():
|
|
188 |
lines = 15
|
189 |
placeholder = "Type or paste text here"
|
190 |
|
191 |
-
blocks = gr.Blocks()
|
192 |
|
193 |
-
with blocks:
|
194 |
gr.Markdown(
|
195 |
dedent(f"""
|
196 |
-
## Ultimatumbee {__version__}
|
197 |
|
198 |
Align non-sequential dualtexts.
|
199 |
|
@@ -212,13 +208,14 @@ def main():
|
|
212 |
)
|
213 |
with gr.Row():
|
214 |
thresh = gr.Slider(
|
215 |
-
minimum=0.
|
216 |
-
maximum=
|
217 |
step=0.1,
|
218 |
value=0.4,
|
219 |
label="threshold",
|
220 |
)
|
221 |
btn = gr.Button("Run")
|
|
|
222 |
_ = """
|
223 |
out_df = gr.outputs.Dataframe(
|
224 |
headers=None,
|
@@ -229,6 +226,7 @@ def main():
|
|
229 |
label="To be aligned",
|
230 |
)
|
231 |
# """
|
|
|
232 |
with gr.Row():
|
233 |
_ = """
|
234 |
aligned = gr.Dataframe(
|
@@ -248,6 +246,7 @@ def main():
|
|
248 |
label="Leftover",
|
249 |
)
|
250 |
# """
|
|
|
251 |
aligned = gr.HTML(label="Aligned")
|
252 |
leftover = gr.HTML(label="Leftover")
|
253 |
|
@@ -270,7 +269,7 @@ def main():
|
|
270 |
|
271 |
|
272 |
if __name__ == "__main__":
|
273 |
-
logger.info(" Start main()")
|
274 |
main()
|
275 |
|
276 |
_ = """
|
|
|
79 |
# 'scores': [0.8885253667831421, 0.10581762343645096, 0.005657028406858444]}
|
80 |
# Runs OK
|
81 |
|
|
|
|
|
|
|
|
|
82 |
|
83 |
# segment: str
|
84 |
def ifn(
|
85 |
text1,
|
86 |
text2,
|
87 |
thresh
|
88 |
+
):
|
89 |
"""Take inputs, return outputs.
|
90 |
|
91 |
Args:
|
|
|
184 |
lines = 15
|
185 |
placeholder = "Type or paste text here"
|
186 |
|
187 |
+
# blocks = gr.Blocks()
|
188 |
|
189 |
+
with gr.Blocks() as blocks:
|
190 |
gr.Markdown(
|
191 |
dedent(f"""
|
192 |
+
## Ultimatumbee-hf-dev {__version__}
|
193 |
|
194 |
Align non-sequential dualtexts.
|
195 |
|
|
|
208 |
)
|
209 |
with gr.Row():
|
210 |
thresh = gr.Slider(
|
211 |
+
minimum=0.1,
|
212 |
+
maximum=0.9,
|
213 |
step=0.1,
|
214 |
value=0.4,
|
215 |
label="threshold",
|
216 |
)
|
217 |
btn = gr.Button("Run")
|
218 |
+
|
219 |
_ = """
|
220 |
out_df = gr.outputs.Dataframe(
|
221 |
headers=None,
|
|
|
226 |
label="To be aligned",
|
227 |
)
|
228 |
# """
|
229 |
+
|
230 |
with gr.Row():
|
231 |
_ = """
|
232 |
aligned = gr.Dataframe(
|
|
|
246 |
label="Leftover",
|
247 |
)
|
248 |
# """
|
249 |
+
|
250 |
aligned = gr.HTML(label="Aligned")
|
251 |
leftover = gr.HTML(label="Leftover")
|
252 |
|
|
|
269 |
|
270 |
|
271 |
if __name__ == "__main__":
|
272 |
+
# logger.info(" Start main()")
|
273 |
main()
|
274 |
|
275 |
_ = """
|