Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -521,7 +521,7 @@ async def get_recommendation(new_crop, image_path, openai_api_key, language, aut
|
|
| 521 |
|
| 522 |
def change_naritive(session_type,image_input, state, click_state, paragraph, origin_image,narritive,task_instruct,gallery_output,style_gallery_result,reco_reasons,language="English"):
|
| 523 |
if session_type=="Session 1":
|
| 524 |
-
return None, [], [], [[], [], []], "", None, None, [], [],[],[],gr.update(value="Preview")
|
| 525 |
else:
|
| 526 |
if language=="English":
|
| 527 |
if narritive=="Narrator" :
|
|
@@ -569,7 +569,7 @@ def change_naritive(session_type,image_input, state, click_state, paragraph, ori
|
|
| 569 |
]
|
| 570 |
|
| 571 |
|
| 572 |
-
return image_input, state, state, click_state, paragraph, origin_image,task_instruct,gallery_output,style_gallery_result,reco_reasons,reco_reasons,gr.update(value="Preview")
|
| 573 |
|
| 574 |
|
| 575 |
def print_like_dislike(x: gr.LikeData,state,log_state):
|
|
@@ -943,9 +943,9 @@ def create_ui():
|
|
| 943 |
paragraph,artist,gender,image_path, log_state,history_log,output_audio])
|
| 944 |
|
| 945 |
example_image.change(
|
| 946 |
-
lambda:([],[],[],None,[],gr.update(value="Preview")),
|
| 947 |
[],
|
| 948 |
-
[gallery_result,style_gallery_result,recommend_bot,new_crop_save_path,chatbot,recommend_type])
|
| 949 |
|
| 950 |
image_input.select(
|
| 951 |
inference_click,
|
|
@@ -1050,7 +1050,7 @@ def create_ui():
|
|
| 1050 |
change_naritive,
|
| 1051 |
[session_type, image_input, state, click_state, paragraph, origin_image,naritive,
|
| 1052 |
task_instuction,gallery_result,style_gallery_result,recomended_state,language],
|
| 1053 |
-
[image_input, chatbot, state, click_state, paragraph, origin_image,task_instuction,gallery_result,style_gallery_result,recomended_state,recommend_bot,recommend_type],
|
| 1054 |
queue=False,
|
| 1055 |
show_progress=False
|
| 1056 |
|
|
|
|
| 521 |
|
| 522 |
def change_naritive(session_type,image_input, state, click_state, paragraph, origin_image,narritive,task_instruct,gallery_output,style_gallery_result,reco_reasons,language="English"):
|
| 523 |
if session_type=="Session 1":
|
| 524 |
+
return None, [], [], [[], [], []], "", None, None, [], [],[],[],gr.update(value="Preview"),[]
|
| 525 |
else:
|
| 526 |
if language=="English":
|
| 527 |
if narritive=="Narrator" :
|
|
|
|
| 569 |
]
|
| 570 |
|
| 571 |
|
| 572 |
+
return image_input, state, state, click_state, paragraph, origin_image,task_instruct,gallery_output,style_gallery_result,reco_reasons,reco_reasons,gr.update(value="Preview"),[]
|
| 573 |
|
| 574 |
|
| 575 |
def print_like_dislike(x: gr.LikeData,state,log_state):
|
|
|
|
| 943 |
paragraph,artist,gender,image_path, log_state,history_log,output_audio])
|
| 944 |
|
| 945 |
example_image.change(
|
| 946 |
+
lambda:([],[],[],None,[],gr.update(value="Preview"),[]),
|
| 947 |
[],
|
| 948 |
+
[gallery_result,style_gallery_result,recommend_bot,new_crop_save_path,chatbot,recommend_type,selected_image])
|
| 949 |
|
| 950 |
image_input.select(
|
| 951 |
inference_click,
|
|
|
|
| 1050 |
change_naritive,
|
| 1051 |
[session_type, image_input, state, click_state, paragraph, origin_image,naritive,
|
| 1052 |
task_instuction,gallery_result,style_gallery_result,recomended_state,language],
|
| 1053 |
+
[image_input, chatbot, state, click_state, paragraph, origin_image,task_instuction,gallery_result,style_gallery_result,recomended_state,recommend_bot,recommend_type,selected_image],
|
| 1054 |
queue=False,
|
| 1055 |
show_progress=False
|
| 1056 |
|