Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,24 +24,6 @@ from transformers import (
|
|
| 24 |
from transformers.image_utils import load_image
|
| 25 |
from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
|
| 26 |
|
| 27 |
-
DESCRIPTION = """
|
| 28 |
-
# Gen Vision 🎃
|
| 29 |
-
"""
|
| 30 |
-
|
| 31 |
-
css = '''
|
| 32 |
-
h1 {
|
| 33 |
-
text-align: center;
|
| 34 |
-
display: block;
|
| 35 |
-
}
|
| 36 |
-
|
| 37 |
-
#duplicate-button {
|
| 38 |
-
margin: auto;
|
| 39 |
-
color: #fff;
|
| 40 |
-
background: #1565c0;
|
| 41 |
-
border-radius: 100vh;
|
| 42 |
-
}
|
| 43 |
-
'''
|
| 44 |
-
|
| 45 |
MAX_MAX_NEW_TOKENS = 2048
|
| 46 |
DEFAULT_MAX_NEW_TOKENS = 1024
|
| 47 |
MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
|
|
@@ -335,31 +317,30 @@ demo = gr.ChatInterface(
|
|
| 335 |
gr.Slider(label="Repetition penalty", minimum=1.0, maximum=2.0, step=0.05, value=1.2),
|
| 336 |
],
|
| 337 |
examples=[
|
| 338 |
-
[
|
| 339 |
-
["@pixar
|
| 340 |
-
["@realism
|
| 341 |
-
["
|
| 342 |
-
[
|
| 343 |
-
["
|
| 344 |
-
["@tts1 Who
|
| 345 |
-
["@clothing Fashionable streetwear in
|
| 346 |
-
["@interior
|
| 347 |
-
["@fashion
|
| 348 |
-
["@minimalistic
|
| 349 |
-
["@modern
|
| 350 |
-
["@animaliea
|
| 351 |
-
["@wallpaper
|
| 352 |
-
["@cars
|
| 353 |
-
["@pencilart
|
| 354 |
-
["@artminimalistic
|
| 355 |
-
["@tts2 What causes rainbows
|
| 356 |
],
|
| 357 |
cache_examples=False,
|
| 358 |
type="messages",
|
| 359 |
-
description=
|
| 360 |
-
css=css,
|
| 361 |
fill_height=True,
|
| 362 |
-
textbox=gr.MultimodalTextbox(label="Query Input", file_types=["image"], file_count="multiple", placeholder="
|
| 363 |
stop_btn="Stop Generation",
|
| 364 |
multimodal=True,
|
| 365 |
)
|
|
|
|
| 24 |
from transformers.image_utils import load_image
|
| 25 |
from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
MAX_MAX_NEW_TOKENS = 2048
|
| 28 |
DEFAULT_MAX_NEW_TOKENS = 1024
|
| 29 |
MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
|
|
|
|
| 317 |
gr.Slider(label="Repetition penalty", minimum=1.0, maximum=2.0, step=0.05, value=1.2),
|
| 318 |
],
|
| 319 |
examples=[
|
| 320 |
+
["@realism Chocolate dripping from a donut, hyper-realistic"],
|
| 321 |
+
["@pixar Young man with wavy hair in an armchair, Pixar style"],
|
| 322 |
+
["@realism Futuristic cityscape with neon lights"],
|
| 323 |
+
["Write the python array rotation program"],
|
| 324 |
+
["@photoshoot Dramatic portrait lighting"],
|
| 325 |
+
[{"text": "Summarize the letter", "files": ["examples/1.png"]}],
|
| 326 |
+
["@tts1 Who was Nikola Tesla and how did he die?"],
|
| 327 |
+
["@clothing Fashionable streetwear in the city"],
|
| 328 |
+
["@interior Modern minimalist living room"],
|
| 329 |
+
["@fashion Runway model in haute couture"],
|
| 330 |
+
["@minimalistic Elegant serene landscape"],
|
| 331 |
+
["@modern Abstract geometric art"],
|
| 332 |
+
["@animaliea Cute animal portrait, vibrant colors"],
|
| 333 |
+
["@wallpaper Scenic mountain desktop wallpaper"],
|
| 334 |
+
["@cars Sleek sports car on city streets"],
|
| 335 |
+
["@pencilart Detailed historic building sketch"],
|
| 336 |
+
["@artminimalistic Subtle minimalist artwork"],
|
| 337 |
+
["@tts2 What causes rainbows?"],
|
| 338 |
],
|
| 339 |
cache_examples=False,
|
| 340 |
type="messages",
|
| 341 |
+
description="# **Gen Vision** `tts: @tts1 @tts2` \n `image-tags: @realism, @pixar, @photoshoot, @clothing, @interior, @fashion, @minimalistic, @modern, @animaliea, @wallpaper, @cars, @pencilart, @artminimalistic` \n `default: chat, image inference`",
|
|
|
|
| 342 |
fill_height=True,
|
| 343 |
+
textbox=gr.MultimodalTextbox(label="Query Input", file_types=["image"], file_count="multiple", placeholder="text, image-infer, image-generation, tts"),
|
| 344 |
stop_btn="Stop Generation",
|
| 345 |
multimodal=True,
|
| 346 |
)
|