Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,6 +46,7 @@ def llm_response(history,text,img):
|
|
| 46 |
return history
|
| 47 |
|
| 48 |
# Function that takes User Inputs and displays it on ChatUI
|
|
|
|
| 49 |
def output_query_message(txt,img):
|
| 50 |
if not img:
|
| 51 |
return txt
|
|
@@ -71,33 +72,26 @@ def output_llm_response(text,img):
|
|
| 71 |
def sentence_builder(animal, place):
|
| 72 |
return f"""how many {animal}s from the {place} are shown in the picture?"""
|
| 73 |
|
| 74 |
-
|
| 75 |
# gradio block
|
| 76 |
|
| 77 |
with gr.Blocks(theme='snehilsanyal/scikit-learn') as app1:
|
| 78 |
-
title =
|
| 79 |
with gr.Column():
|
| 80 |
-
outputbox = gr.Textbox(label="
|
| 81 |
-
text_box = gr.Dropdown(
|
| 82 |
-
["what is in the image",
|
| 83 |
-
"provide alternative title for the image",
|
| 84 |
-
"how many birds can be seen in the picture?"],
|
| 85 |
-
label="Prompts", info="Will add more animals later!"
|
| 86 |
-
)
|
| 87 |
image_box = gr.Image(type="filepath")
|
| 88 |
|
| 89 |
-
btn = gr.Button("
|
| 90 |
clicked = btn.click(output_query_message,
|
| 91 |
-
[
|
| 92 |
outputbox
|
| 93 |
).then(output_llm_response,
|
| 94 |
-
[
|
| 95 |
outputbox
|
| 96 |
)
|
| 97 |
gr.Markdown("""
|
| 98 |
-
|
| 99 |
|
| 100 |
-
<h5 align="center"><i>"
|
| 101 |
|
| 102 |
Multimodal-CoT incorporates vision features in a decoupled training framework. The framework consists of two training stages: (i) rationale generation and (ii) answer inference. Both stages share the same model architecture but differ in the input and output.
|
| 103 |
""")
|
|
@@ -128,8 +122,8 @@ with gr.Blocks(theme='snehilsanyal/scikit-learn') as app2:
|
|
| 128 |
chatbot
|
| 129 |
)
|
| 130 |
with gr.Blocks(theme='snehilsanyal/scikit-learn') as demo:
|
| 131 |
-
gr.Markdown("
|
| 132 |
-
gr.TabbedInterface([app1, app2], ["
|
| 133 |
|
| 134 |
demo.queue()
|
| 135 |
demo.launch()
|
|
|
|
| 46 |
return history
|
| 47 |
|
| 48 |
# Function that takes User Inputs and displays it on ChatUI
|
| 49 |
+
text_box_01 = "what is in the image"
|
| 50 |
def output_query_message(txt,img):
|
| 51 |
if not img:
|
| 52 |
return txt
|
|
|
|
| 72 |
def sentence_builder(animal, place):
|
| 73 |
return f"""how many {animal}s from the {place} are shown in the picture?"""
|
| 74 |
|
|
|
|
| 75 |
# gradio block
|
| 76 |
|
| 77 |
with gr.Blocks(theme='snehilsanyal/scikit-learn') as app1:
|
| 78 |
+
title = 'line clearance'
|
| 79 |
with gr.Column():
|
| 80 |
+
outputbox = gr.Textbox(label="result here...")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
image_box = gr.Image(type="filepath")
|
| 82 |
|
| 83 |
+
btn = gr.Button("Check This")
|
| 84 |
clicked = btn.click(output_query_message,
|
| 85 |
+
[text_box_01,image_box],
|
| 86 |
outputbox
|
| 87 |
).then(output_llm_response,
|
| 88 |
+
[text_box_01,image_box],
|
| 89 |
outputbox
|
| 90 |
)
|
| 91 |
gr.Markdown("""
|
| 92 |
+
## SOP-302: Line Clearance ##
|
| 93 |
|
| 94 |
+
<h5 align="center"><i>"XXXX here here."</i></h5>
|
| 95 |
|
| 96 |
Multimodal-CoT incorporates vision features in a decoupled training framework. The framework consists of two training stages: (i) rationale generation and (ii) answer inference. Both stages share the same model architecture but differ in the input and output.
|
| 97 |
""")
|
|
|
|
| 122 |
chatbot
|
| 123 |
)
|
| 124 |
with gr.Blocks(theme='snehilsanyal/scikit-learn') as demo:
|
| 125 |
+
gr.Markdown("## SOP Camera ##")
|
| 126 |
+
gr.TabbedInterface([app1, app2], ["Check #1", "Check #2"])
|
| 127 |
|
| 128 |
demo.queue()
|
| 129 |
demo.launch()
|