Update text2image.py

#1
by kuyee - opened
Files changed (1) hide show
  1. text2image.py +2 -2
text2image.py CHANGED
@@ -12,7 +12,7 @@ def explain_image(image: Image.Image):
12
  # η›΄ζŽ₯把 PIL image ε‚³ι€²εŽ»
13
  response = client.models.generate_content(
14
  model="gemini-2.0-flash",
15
- contents=[image, "δ½Ώη”¨ηΉι«”δΈ­ζ–‡ζθΏ°ι€™εΌ΅εœ–η‰‡"],
16
  )
17
  # ε–ε‡Ίε›žη­”
18
  explanation = response.text
@@ -20,7 +20,7 @@ def explain_image(image: Image.Image):
20
 
21
  # Gradio 介青
22
  with gr.Blocks() as demo:
23
- gr.Markdown("## 🧠(9999999)Gemini εœ–η‰‡θ§£ι‡‹ε™¨οΌˆεœ– ➜ ζ–‡οΌ‰")
24
  image_input = gr.Image(type="pil", label="δΈŠε‚³εœ–η‰‡")
25
  explain_button = gr.Button("θ§£ι‡‹εœ–η‰‡")
26
  output_text = gr.Textbox(label="εœ–η‰‡θͺͺ明", lines=5)
 
12
  # η›΄ζŽ₯把 PIL image ε‚³ι€²εŽ»
13
  response = client.models.generate_content(
14
  model="gemini-2.0-flash",
15
+ contents=[image, "使用法θͺžζθΏ°ι€™εΌ΅εœ–片"],
16
  )
17
  # ε–ε‡Ίε›žη­”
18
  explanation = response.text
 
20
 
21
  # Gradio 介青
22
  with gr.Blocks() as demo:
23
+ gr.Markdown("## 🧠(B11090070)Gemini εœ–η‰‡θ§£ι‡‹ε™¨οΌˆεœ– ➜ ζ–‡οΌ‰")
24
  image_input = gr.Image(type="pil", label="δΈŠε‚³εœ–η‰‡")
25
  explain_button = gr.Button("θ§£ι‡‹εœ–η‰‡")
26
  output_text = gr.Textbox(label="εœ–η‰‡θͺͺ明", lines=5)