hsienchen commited on
Commit
60361bd
1 Parent(s): ac0e7b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -31,6 +31,7 @@ import os
31
  GOOGLE_API_KEY=os.getenv('GOOGLE_API_KEY')
32
  genai.configure(api_key=GOOGLE_API_KEY)
33
 
 
34
  # Image to Base 64 Converter
35
  def image_to_base64(image_path):
36
  with open(image_path, 'rb') as img:
@@ -55,20 +56,28 @@ def app1_response(img):
55
  img = PIL.Image.open(img)
56
  response = vis_model.generate_content([txt_prompt_1,img])
57
  return response.text
58
-
 
 
59
 
60
  # gradio block
61
-
62
  with gr.Blocks(theme='snehilsanyal/scikit-learn') as app1:
63
  with gr.Column():
64
  image_box = gr.Image(type="filepath")
 
65
  outputbox = gr.Textbox(label="here are the plans...")
66
-
67
- btn = gr.Button("Make a Plan")
 
68
  clicked = btn.click(app1_response,
69
  [image_box],
70
  outputbox
71
  )
 
 
 
 
 
72
  gr.Markdown("""
73
  # Make a Plan #
74
 
 
31
  GOOGLE_API_KEY=os.getenv('GOOGLE_API_KEY')
32
  genai.configure(api_key=GOOGLE_API_KEY)
33
 
34
+ sms_text ="..."
35
  # Image to Base 64 Converter
36
  def image_to_base64(image_path):
37
  with open(image_path, 'rb') as img:
 
56
  img = PIL.Image.open(img)
57
  response = vis_model.generate_content([txt_prompt_1,img])
58
  return response.text
59
+
60
+ def app2_response(text):
61
+ return text
62
 
63
  # gradio block
 
64
  with gr.Blocks(theme='snehilsanyal/scikit-learn') as app1:
65
  with gr.Column():
66
  image_box = gr.Image(type="filepath")
67
+ btn = gr.Button("Make a Plan")
68
  outputbox = gr.Textbox(label="here are the plans...")
69
+ btn2 = gr.Button("Send to My Mobile")
70
+ outputbox2 = gr.Textbox(label="to mobile...")
71
+
72
  clicked = btn.click(app1_response,
73
  [image_box],
74
  outputbox
75
  )
76
+ clicked = btn.click(app2_response,
77
+ outputbox,
78
+ outputbox2
79
+ )
80
+
81
  gr.Markdown("""
82
  # Make a Plan #
83