VictorSanh commited on
Commit
c678872
1 Parent(s): b4bb4ae

front changes

Browse files
app_dialogue.py CHANGED
@@ -60,7 +60,7 @@ BAN_TOKENS = ( # For documentation puporse. We are not using this list, it is h
60
  EOS_STRINGS = ["<end_of_utterance>", "\nUser:"]
61
  STOP_SUSPECT_LIST = []
62
 
63
- GRADIO_LINK = "https://victorsanh-meme-it.hf.space"
64
  API_TOKEN = os.getenv("HF_AUTH_TOKEN")
65
  IDEFICS_LOGO = "https://huggingface.co/spaces/HuggingFaceM4/idefics_playground/resolve/main/IDEFICS_logo.png"
66
 
@@ -109,7 +109,7 @@ DEFAULT_IMAGES_TMP_PATH_TO_URL = {}
109
  for im_path in all_images:
110
  H = gr.Image(im_path, visible=False, type="filepath")
111
  tmp_filename = H.preprocess(H.value)
112
- DEFAULT_IMAGES_TMP_PATH_TO_URL[tmp_filename] = f"https://huggingface.co/spaces/HuggingFaceM4/idefics_playground/resolve/main/example_images/{os.path.basename(im_path)}"
113
 
114
 
115
  # Utils to handle the image markdown display logic
@@ -324,21 +324,21 @@ def format_user_prompt_with_im_history_and_system_conditioning(
324
  # problematic_callback = gr.CSVLogger()
325
 
326
  textbox = gr.Textbox(
327
- placeholder="Upload an image and start conversing by sending a message! You can add an image at each turn, but don't have to.",
328
  show_label=False,
329
  # value="Write something funny about that image.",
330
  visible=True,
331
  container=False,
332
  label="Text input",
333
- scale=6,
334
  max_lines=5,
335
  )
336
  chatbot = gr.Chatbot(
337
  elem_id="chatbot",
338
- label="IDEFICS",
339
  visible=True,
340
  height=750,
341
- avatar_images=[None, BOT_AVATAR]
342
  )
343
 
344
  with gr.Blocks(title="AI Dad Jokes", theme=gr.themes.Base()) as demo:
@@ -683,10 +683,6 @@ with gr.Blocks(title="AI Dad Jokes", theme=gr.themes.Base()) as demo:
683
  "Write a meme text for that image.",
684
  f"{examples_path}/example_images/citibike.webp",
685
  ],
686
- [
687
- "Write something funny about that. A meme for instance.",
688
- f"{examples_path}/example_images/zuck.jpeg",
689
- ],
690
  [
691
  "Craft a humorous caption for this image!",
692
  f"{examples_path}/example_images/echasse.jpg",
@@ -730,5 +726,13 @@ with gr.Blocks(title="AI Dad Jokes", theme=gr.themes.Base()) as demo:
730
  ),
731
  )
732
 
 
 
 
 
 
 
 
 
733
  demo.queue(concurrency_count=40, max_size=40)
734
  demo.launch()
 
60
  EOS_STRINGS = ["<end_of_utterance>", "\nUser:"]
61
  STOP_SUSPECT_LIST = []
62
 
63
+ GRADIO_LINK = "https://victorsanh-ai-dad-jokes.hf.space"
64
  API_TOKEN = os.getenv("HF_AUTH_TOKEN")
65
  IDEFICS_LOGO = "https://huggingface.co/spaces/HuggingFaceM4/idefics_playground/resolve/main/IDEFICS_logo.png"
66
 
 
109
  for im_path in all_images:
110
  H = gr.Image(im_path, visible=False, type="filepath")
111
  tmp_filename = H.preprocess(H.value)
112
+ DEFAULT_IMAGES_TMP_PATH_TO_URL[tmp_filename] = f"https://huggingface.co/spaces/HuggingFaceM4/ai_dad_jokes/resolve/main/example_images/{os.path.basename(im_path)}"
113
 
114
 
115
  # Utils to handle the image markdown display logic
 
324
  # problematic_callback = gr.CSVLogger()
325
 
326
  textbox = gr.Textbox(
327
+ placeholder="Upload an image and begin chatting with a message! Images can be added at each turn.",
328
  show_label=False,
329
  # value="Write something funny about that image.",
330
  visible=True,
331
  container=False,
332
  label="Text input",
333
+ scale=8,
334
  max_lines=5,
335
  )
336
  chatbot = gr.Chatbot(
337
  elem_id="chatbot",
338
+ label="AI Dad Jokes",
339
  visible=True,
340
  height=750,
341
+ avatar_images=[None, BOT_AVATAR]
342
  )
343
 
344
  with gr.Blocks(title="AI Dad Jokes", theme=gr.themes.Base()) as demo:
 
683
  "Write a meme text for that image.",
684
  f"{examples_path}/example_images/citibike.webp",
685
  ],
 
 
 
 
686
  [
687
  "Craft a humorous caption for this image!",
688
  f"{examples_path}/example_images/echasse.jpg",
 
726
  ),
727
  )
728
 
729
+ gr.HTML("""
730
+ <div style="text-align: center; max-width: 650px; margin: 0 auto;">
731
+ <p>
732
+ Example images from <a href="https://www.instagram.com/whatisnewyork/">Whatisnewyork</a>.
733
+ </p>
734
+ </div>
735
+ """)
736
+
737
  demo.queue(concurrency_count=40, max_size=40)
738
  demo.launch()
example_images/art_critic.png DELETED

Git LFS Details

  • SHA256: ce625047472202ae8c6c35a0f658537da6f2bc6948490ca092da8ab3af5503d9
  • Pointer size: 130 Bytes
  • Size of remote file: 87.1 kB
example_images/baguettes_guarding_paris.png DELETED

Git LFS Details

  • SHA256: e0d85c7bf554da5f08279311bacb8fec264da5922ea800f6364a23ff8390b7dc
  • Pointer size: 131 Bytes
  • Size of remote file: 609 kB
example_images/bear_costume.png DELETED

Git LFS Details

  • SHA256: d194a74160b8daa7cc6edc9d728b984e721c7ac846a8411d751123c0a3659888
  • Pointer size: 131 Bytes
  • Size of remote file: 499 kB
example_images/blue_dog.png DELETED

Git LFS Details

  • SHA256: f58e1b942108f6188d5cd80b072de22f7000df01361cfbef2da7c5ae2ae8d806
  • Pointer size: 131 Bytes
  • Size of remote file: 323 kB
example_images/can_horror.png DELETED

Git LFS Details

  • SHA256: 06d427fc01adbc02547a740e13b856552808cf21d10fdad437578a0d5b56833b
  • Pointer size: 131 Bytes
  • Size of remote file: 277 kB
example_images/cat_sketch.png DELETED

Git LFS Details

  • SHA256: c79410172194e679fae350cf9168b6b2d2fee47259cf60d7dbb079deb5efc4c0
  • Pointer size: 130 Bytes
  • Size of remote file: 37.7 kB
example_images/chicken_on_money.png DELETED

Git LFS Details

  • SHA256: f6b1232d2d90e74959c3bd92be67a80597705132b2d879aba43e00838676b902
  • Pointer size: 131 Bytes
  • Size of remote file: 420 kB
example_images/concrete-eating-willsmith.jpg DELETED
Binary file (79.7 kB)
 
example_images/dragons_playing.png DELETED

Git LFS Details

  • SHA256: 17421156f918e9039cecc328cf42b61ba6c57d38e3a0a8ad9125be57d63de286
  • Pointer size: 131 Bytes
  • Size of remote file: 626 kB
example_images/elon_smoking.jpg DELETED
Binary file (57 kB)
 
example_images/gandhi_selfie.jpg DELETED
Binary file (98.8 kB)
 
example_images/gaulois.png DELETED

Git LFS Details

  • SHA256: 83dd9cd4a9fdb43350e9b87503620db33b1e5d8aeefb4b77a32b7a0293a627be
  • Pointer size: 132 Bytes
  • Size of remote file: 1.13 MB
example_images/ironman_cap.png DELETED

Git LFS Details

  • SHA256: fbe2ca189188d7cee4ea252e0b2e16c8e0d68b093fc0d4416e141c4cba1c41f3
  • Pointer size: 131 Bytes
  • Size of remote file: 465 kB
example_images/kanye.jpg DELETED
Binary file (13.6 kB)
 
example_images/meme_french.jpg DELETED
Binary file (70.7 kB)
 
example_images/obama-harry-potter.jpg DELETED
Binary file (18.9 kB)
 
example_images/plant_bulb.webp DELETED
Binary file (20.3 kB)
 
example_images/polar_bear_coke.png DELETED

Git LFS Details

  • SHA256: c2c6524fc5d6ec6a6ee0ee1d9e0258dcb49cdde844300688c4c70d19370202ab
  • Pointer size: 131 Bytes
  • Size of remote file: 440 kB
example_images/pope_doudoune.webp DELETED
Binary file (46.1 kB)
 
example_images/product_ad.jpg DELETED
Binary file (82.6 kB)
 
example_images/rabbit_force.png DELETED

Git LFS Details

  • SHA256: c2f743e0cfaf80e4426da62d7ad8a5f10c5aa4aad3a6da06ff7f2882dbfe4a96
  • Pointer size: 131 Bytes
  • Size of remote file: 466 kB
example_images/ramen.png DELETED

Git LFS Details

  • SHA256: 6d5242fd9cb860656083e90c1eaadc6a01baf7ed795225e40b1a3686ac2d70ca
  • Pointer size: 131 Bytes
  • Size of remote file: 909 kB
example_images/recipe_burger.webp DELETED
Binary file (146 kB)
 
example_images/ryan-reynolds-borg.jpg DELETED
Binary file (19.6 kB)
 
example_images/surfing_dog.jpg DELETED
Binary file (283 kB)
 
example_images/tom-cruise-astronaut-pegasus.jpg DELETED
Binary file (27.4 kB)
 
example_images/travel_tips.jpg DELETED
Binary file (209 kB)
 
example_images/tree_fortress.jpg DELETED
Binary file (154 kB)
 
example_images/zuck.jpeg DELETED
Binary file (28.1 kB)