zR commited on
Commit
c9f689e
·
1 Parent(s): 58bd064
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -101,6 +101,7 @@ def predict(history, max_length, top_p, temperature, img_path, platform_str, for
101
  "do_sample": True if temperature > 0.0 else False,
102
  "top_p": top_p,
103
  "temperature": temperature,
 
104
  }
105
  t = Thread(target=model.generate, kwargs=generate_kwargs)
106
  t.start()
@@ -186,11 +187,12 @@ def main():
186
  with gr.Blocks(analytics_enabled=False) as demo:
187
  gr.HTML("<h1 align='center'>CogAgent-9B-20241220 Demo</h1>")
188
  gr.HTML(
189
- "<p align='center' style='color:red;'>This Demo is for learning and communication purposes only. Users must assume responsibility for the risks associated with AI-generated planning and operations.</p>")
190
-
 
191
  with gr.Row():
192
  img_path = gr.Image(label="Upload a Screenshot", type="filepath", height=400)
193
- output_img = gr.Image(type="filepath", label="Annotated Image", height=400, interactive=False)
194
 
195
  with gr.Row():
196
  with gr.Column(scale=2):
 
101
  "do_sample": True if temperature > 0.0 else False,
102
  "top_p": top_p,
103
  "temperature": temperature,
104
+ "top_k": 1,
105
  }
106
  t = Thread(target=model.generate, kwargs=generate_kwargs)
107
  t.start()
 
187
  with gr.Blocks(analytics_enabled=False) as demo:
188
  gr.HTML("<h1 align='center'>CogAgent-9B-20241220 Demo</h1>")
189
  gr.HTML(
190
+ "<p align='center' style='color:red;'>This demo is for learning and communication purposes only. Users must assume responsibility for the risks associated with AI-generated planning and operations.</p>"
191
+ "<p align='left' style='color:black;'>1. Upload an image. 2. Provide your instructions to CogAgent. 3. Wait for CogAgent to return specific operations, and if there are bounding boxes (Bbox), they will be displayed in the image area on the right.</p>"
192
+ )
193
  with gr.Row():
194
  img_path = gr.Image(label="Upload a Screenshot", type="filepath", height=400)
195
+ output_img = gr.Image(type="filepath", label="Annotated Image(If Bbox Return)", height=400, interactive=False)
196
 
197
  with gr.Row():
198
  with gr.Column(scale=2):