hsienchen commited on
Commit
18fc664
1 Parent(s): 6232daa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -12
app.py CHANGED
@@ -10,8 +10,21 @@ import pathlib
10
  txt_model = genai.GenerativeModel('gemini-pro')
11
  vis_model = genai.GenerativeModel('gemini-pro-vision')
12
 
13
- txt_prompt_1 = 'The image contains content of a letter. I like to comply with the request mentioned in the letter. Please provide 3 actionable items to assist me.'
14
- txt_display_1 = 'name the missing items on B'
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  import os
17
 
@@ -79,10 +92,10 @@ def sentence_builder(animal, place):
79
 
80
  with gr.Blocks(theme='snehilsanyal/scikit-learn') as app1:
81
  with gr.Column():
82
- outputbox = gr.Textbox(label="actionables...")
83
  image_box = gr.Image(type="filepath")
84
 
85
- btn = gr.Button("Actionables")
86
  clicked = btn.click(app1_query,
87
  [image_box],
88
  outputbox
@@ -91,15 +104,15 @@ with gr.Blocks(theme='snehilsanyal/scikit-learn') as app1:
91
  outputbox
92
  )
93
  gr.Markdown("""
94
- ##Actionables##
95
 
96
- <h5 align="center"><i>"ScreenShot and Action!"</i></h5>
97
 
98
- Screen capture the email and ask Bot (Gemini) to summarize and provide THREE actionable items.
99
  """)
100
 
101
  with gr.Blocks(theme='snehilsanyal/scikit-learn') as app2:
102
- gr.Markdown("## MM 2BB ##")
103
  with gr.Row():
104
  image_box = gr.Image(type="filepath")
105
 
@@ -110,9 +123,10 @@ with gr.Blocks(theme='snehilsanyal/scikit-learn') as app2:
110
  text_box = gr.Dropdown(
111
  ["what is in the image",
112
  "provide alternative title for the image",
113
- "how many birds can be seen in the picture?"],
 
114
  label="Select--",
115
- info="Will add more animals later!"
116
  )
117
 
118
  btn = gr.Button("Submit")
@@ -124,8 +138,8 @@ with gr.Blocks(theme='snehilsanyal/scikit-learn') as app2:
124
  chatbot
125
  )
126
  with gr.Blocks(theme='snehilsanyal/scikit-learn') as demo:
127
- gr.Markdown("## SOP Camera ##")
128
- gr.TabbedInterface([app1, app2], ["Actions!", "Check Relevance!"])
129
 
130
  demo.queue()
131
  demo.launch()
 
10
  txt_model = genai.GenerativeModel('gemini-pro')
11
  vis_model = genai.GenerativeModel('gemini-pro-vision')
12
 
13
+ txt_prompt_1 = """The image contains the contents of a letter. I'd like to follow the request mentioned in the letter. Please provide 3 actionable items to assist me. When responding, use the following format:
14
+
15
+ # Sender and Subject #
16
+ 1- Action 1 (no more than 20 words)
17
+ 2- Action 2 (no more than 20 words)
18
+ 3- Action 3 (no more than 20 words)
19
+
20
+ For example:
21
+ # From Richard regarding 'Shipping to Customer ABC' #
22
+ 1- Pack Product A
23
+ 2- Ship before 3:00 PM today
24
+ 3- Notify Richard after shipment
25
+ """
26
+
27
+ txt_display_1 = 'content of email'
28
 
29
  import os
30
 
 
92
 
93
  with gr.Blocks(theme='snehilsanyal/scikit-learn') as app1:
94
  with gr.Column():
95
+ outputbox = gr.Textbox(label="here are the plans...")
96
  image_box = gr.Image(type="filepath")
97
 
98
+ btn = gr.Button("Make a Plan")
99
  clicked = btn.click(app1_query,
100
  [image_box],
101
  outputbox
 
104
  outputbox
105
  )
106
  gr.Markdown("""
107
+ # Make a Plan #
108
 
109
+ <h3 align="center"><i>"ScreenShot and Action!"</i></h3>
110
 
111
+ Screen capture the email and ask LLM Bot (Gemini, in this case) to summarize and provide THREE actionable items.
112
  """)
113
 
114
  with gr.Blocks(theme='snehilsanyal/scikit-learn') as app2:
115
+ gr.Markdown("check the image...")
116
  with gr.Row():
117
  image_box = gr.Image(type="filepath")
118
 
 
123
  text_box = gr.Dropdown(
124
  ["what is in the image",
125
  "provide alternative title for the image",
126
+ "how many parts can be seen in the picture?",
127
+ "check ID and expiration date"],
128
  label="Select--",
129
+ info="ask Bot"
130
  )
131
 
132
  btn = gr.Button("Submit")
 
138
  chatbot
139
  )
140
  with gr.Blocks(theme='snehilsanyal/scikit-learn') as demo:
141
+ gr.Markdown("## Workflow Bot ##")
142
+ gr.TabbedInterface([app1, app2], ["Make a Plan!", "Check This!"])
143
 
144
  demo.queue()
145
  demo.launch()