Junfeng5 commited on
Commit
f3fb44a
·
verified ·
1 Parent(s): 9eb57f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -23
app.py CHANGED
@@ -299,38 +299,40 @@ with gr.Blocks(fill_height=True) as demo:
299
  top_K = gr.Slider(1, 8192, value=4096, label="Top K")
300
  top_P = gr.Slider(0.0, 1.0, value=0.99, label="Top P")
301
 
302
- aaa = gr.ChatInterface(
303
- fn=bot_streaming_T2I,
304
- examples=[
305
- ["young blue dragon with horn lightning in the style of dd fantasy full body",5.0, 0.9,4096,0.99],
306
- ["A majestic Goddes of beauty, charming dressed in a regal, jeweled gown and ornate crown, her golden hair cascading down her back, in the style of Pino Daeni",5.0, 0.9,4096,0.99],
307
- ["A highly realistic, closeup photograph of a beautiful 35 year old redread woman writing in her journal, sitting on her balcony wearing warm, stylish outfits. Shot on a Canon EOS R5, the image boasts sharp focus and intricate details. The heartwarming scene conveys love, connection, and the crisp winter atmosphere, dramatic lighting.",5.0, 0.9,4096,0.99],
308
- ["Portrait of an asian woman. She has pink violet hair style with modern complex hairdressing. The background is dark with cyberpunk neon lights. Inspired by Cyberpunk 2077 and Blade Runner. Ultra realistic picture. To capture the image, you will use a fullframe DSLR or mirrorless camera with a highresolution sensor, an aperture of f2.8 or wider, and a shutter speed of 1500 second or faster. You will use natural light and reflectors to create a balanced and welllit image, and will experiment with different angles and compositions to create the most i",5.0, 0.9,4096,0.99],
309
- ["female character fantasy world, for fantasy story, protagonist, interesting and detailed clothes, beautiful, medieval fantasy cinematic shot photo taken by canon, photo taken by fuji, photo taken by kodak incredibly detailed, sharpen, details professional lighting , film lighting 350mm lightroom cinematography, hyper realism, cinematic, film quality",5.0, 0.9,4096,0.99],
310
- ["strawberries splashing, swirling liquid, realism, octane render, raytracing",5.0, 0.9,4096,0.99],
311
- ["hedgehog face, floating in space, wearing space suit no helmet, cinematic, 50mm f1.8, unreal engine 5",5.0, 0.9,4096,0.99],
312
- ["artificial intelligence, revolution, publishing, writer, hyperrealistic",5.0, 0.9,4096,0.99],
313
- ["A pig dressed as a mason, by Bill Gekas",5.0, 0.9,4096,0.99],
314
- ],
315
- stop_btn="Stop Generation",
316
- additional_inputs = [guidance_scale, temperature, top_K, top_P],
317
- additional_inputs_accordion="⚙️ Advanced Settings",
318
- multimodal=False,
319
- textbox=chat_input_T2I,
320
- chatbot=chatbot_T2I,
321
- fill_height=True,
322
- )
 
323
 
324
 
325
 
326
 
327
  with gr.Tab("Image To Text"):
328
- bbb = gr.ChatInterface(
329
  fn=bot_streaming_I2T,
330
  examples=[ {"text": "How to make this pastry?", "files": ["./baklava.png"]}],
331
  description="Upload an image and start chatting about it, or simply try one of the examples below. If you don't upload an image, you will receive an error.",
332
  stop_btn="Stop Generation",
333
  multimodal=True,
 
334
  textbox=chat_input_I2T,
335
  chatbot=chatbot_I2T,
336
  )
@@ -348,9 +350,10 @@ with gr.Blocks(fill_height=True) as demo:
348
  stop_btn="Stop Generation",
349
  additional_inputs = [texttemperature],
350
  additional_inputs_accordion="⚙️ Advanced Settings",
 
351
  multimodal=False,
352
  textbox=chat_input_T2T,
353
  chatbot=chatbot_T2T,
354
  )
355
- demo.queue(api_open=False)
356
  demo.launch(allowed_paths=["./"], share=False )
 
299
  top_K = gr.Slider(1, 8192, value=4096, label="Top K")
300
  top_P = gr.Slider(0.0, 1.0, value=0.99, label="Top P")
301
 
302
+ gr.ChatInterface(
303
+ fn=bot_streaming_T2I,
304
+ examples=[
305
+ ["young blue dragon with horn lightning in the style of dd fantasy full body",5.0, 0.9,4096,0.99],
306
+ ["A majestic Goddes of beauty, charming dressed in a regal, jeweled gown and ornate crown, her golden hair cascading down her back, in the style of Pino Daeni",5.0, 0.9,4096,0.99],
307
+ ["A highly realistic, closeup photograph of a beautiful 35 year old redread woman writing in her journal, sitting on her balcony wearing warm, stylish outfits. Shot on a Canon EOS R5, the image boasts sharp focus and intricate details. The heartwarming scene conveys love, connection, and the crisp winter atmosphere, dramatic lighting.",5.0, 0.9,4096,0.99],
308
+ ["Portrait of an asian woman. She has pink violet hair style with modern complex hairdressing. The background is dark with cyberpunk neon lights. Inspired by Cyberpunk 2077 and Blade Runner. Ultra realistic picture. To capture the image, you will use a fullframe DSLR or mirrorless camera with a highresolution sensor, an aperture of f2.8 or wider, and a shutter speed of 1500 second or faster. You will use natural light and reflectors to create a balanced and welllit image, and will experiment with different angles and compositions to create the most i",5.0, 0.9,4096,0.99],
309
+ ["female character fantasy world, for fantasy story, protagonist, interesting and detailed clothes, beautiful, medieval fantasy cinematic shot photo taken by canon, photo taken by fuji, photo taken by kodak incredibly detailed, sharpen, details professional lighting , film lighting 350mm lightroom cinematography, hyper realism, cinematic, film quality",5.0, 0.9,4096,0.99],
310
+ ["strawberries splashing, swirling liquid, realism, octane render, raytracing",5.0, 0.9,4096,0.99],
311
+ ["hedgehog face, floating in space, wearing space suit no helmet, cinematic, 50mm f1.8, unreal engine 5",5.0, 0.9,4096,0.99],
312
+ ["artificial intelligence, revolution, publishing, writer, hyperrealistic",5.0, 0.9,4096,0.99],
313
+ ["A pig dressed as a mason, by Bill Gekas",5.0, 0.9,4096,0.99],
314
+ ],
315
+ stop_btn="Stop Generation",
316
+ additional_inputs = [guidance_scale, temperature, top_K, top_P],
317
+ additional_inputs_accordion="⚙️ Advanced Settings",
318
+ multimodal=False,
319
+ cache_examples=False,
320
+ textbox=chat_input_T2I,
321
+ chatbot=chatbot_T2I,
322
+ fill_height=True,
323
+ )
324
 
325
 
326
 
327
 
328
  with gr.Tab("Image To Text"):
329
+ gr.ChatInterface(
330
  fn=bot_streaming_I2T,
331
  examples=[ {"text": "How to make this pastry?", "files": ["./baklava.png"]}],
332
  description="Upload an image and start chatting about it, or simply try one of the examples below. If you don't upload an image, you will receive an error.",
333
  stop_btn="Stop Generation",
334
  multimodal=True,
335
+ cache_examples=False,
336
  textbox=chat_input_I2T,
337
  chatbot=chatbot_I2T,
338
  )
 
350
  stop_btn="Stop Generation",
351
  additional_inputs = [texttemperature],
352
  additional_inputs_accordion="⚙️ Advanced Settings",
353
+ cache_examples=False,
354
  multimodal=False,
355
  textbox=chat_input_T2T,
356
  chatbot=chatbot_T2T,
357
  )
358
+ # demo.queue(api_open=False)
359
  demo.launch(allowed_paths=["./"], share=False )