Update app.py
Browse files
app.py
CHANGED
|
@@ -34,7 +34,7 @@ def sort_doc(in_list: list, steps_in: int, control: int, prev_list: str):
|
|
| 34 |
print(f'CONTROL_VAL_BOX:: {control_val_box}')
|
| 35 |
#prev_list=control_val_box
|
| 36 |
json_out={}
|
| 37 |
-
|
| 38 |
big_cnt=0
|
| 39 |
cnt=0
|
| 40 |
go=True
|
|
@@ -82,11 +82,12 @@ def sort_doc(in_list: list, steps_in: int, control: int, prev_list: str):
|
|
| 82 |
#print(j)
|
| 83 |
out_js = out_js+control_char[j]
|
| 84 |
json_out[out_js]=in_list[i]
|
|
|
|
| 85 |
big_cnt+=1
|
| 86 |
if big_cnt==key_cnt:
|
| 87 |
print("DONE")
|
| 88 |
go=False
|
| 89 |
-
return json_out
|
| 90 |
|
| 91 |
|
| 92 |
def sort_doc_OG(in_list: list, steps_in: int, control: int, prev_list: str):
|
|
@@ -203,7 +204,7 @@ def find_query(query,sen,nouns):
|
|
| 203 |
return noun_box,sen_box
|
| 204 |
|
| 205 |
with gr.Blocks() as app:
|
| 206 |
-
inp = gr.Textbox(label="Paste Text",lines=10)
|
| 207 |
with gr.Row():
|
| 208 |
steps=gr.Slider(label="Steps",minimum=0,maximum=12,step=1,value=0)
|
| 209 |
control=gr.Slider(label="Control",minimum=0,maximum=32,step=1,value=0)
|
|
@@ -220,7 +221,7 @@ with gr.Blocks() as app:
|
|
| 220 |
with gr.Column(scale=1):
|
| 221 |
nouns=gr.JSON(label="Nouns")
|
| 222 |
search_btn.click(find_query,[query,sen,nouns],[out_box])
|
| 223 |
-
btn.click(sort_doc,[inp,steps,control,prev_doc],[sen])
|
| 224 |
app.launch()
|
| 225 |
|
| 226 |
|
|
|
|
| 34 |
print(f'CONTROL_VAL_BOX:: {control_val_box}')
|
| 35 |
#prev_list=control_val_box
|
| 36 |
json_out={}
|
| 37 |
+
rev_out={}
|
| 38 |
big_cnt=0
|
| 39 |
cnt=0
|
| 40 |
go=True
|
|
|
|
| 82 |
#print(j)
|
| 83 |
out_js = out_js+control_char[j]
|
| 84 |
json_out[out_js]=in_list[i]
|
| 85 |
+
rev_out[in_list[i]]=out_js
|
| 86 |
big_cnt+=1
|
| 87 |
if big_cnt==key_cnt:
|
| 88 |
print("DONE")
|
| 89 |
go=False
|
| 90 |
+
return json_out,rev_out
|
| 91 |
|
| 92 |
|
| 93 |
def sort_doc_OG(in_list: list, steps_in: int, control: int, prev_list: str):
|
|
|
|
| 204 |
return noun_box,sen_box
|
| 205 |
|
| 206 |
with gr.Blocks() as app:
|
| 207 |
+
inp = gr.Textbox(label="Paste Text",lines=10, value="['skdflsdj','sd','sdfsdf','sdfsddsfsd','sdfsdfd','df']")
|
| 208 |
with gr.Row():
|
| 209 |
steps=gr.Slider(label="Steps",minimum=0,maximum=12,step=1,value=0)
|
| 210 |
control=gr.Slider(label="Control",minimum=0,maximum=32,step=1,value=0)
|
|
|
|
| 221 |
with gr.Column(scale=1):
|
| 222 |
nouns=gr.JSON(label="Nouns")
|
| 223 |
search_btn.click(find_query,[query,sen,nouns],[out_box])
|
| 224 |
+
btn.click(sort_doc,[inp,steps,control,prev_doc],[sen,nouns])
|
| 225 |
app.launch()
|
| 226 |
|
| 227 |
|