miaw1419 commited on
Commit
1d8054a
1 Parent(s): 62beae5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -61,6 +61,14 @@ with gr.Blocks(css=css, title="ViPer Demo", theme=gr.themes.Base()) as demo:
61
  quantization_config=bnb_config,
62
  )
63
 
 
 
 
 
 
 
 
 
64
  vpe_model = PeftModel.from_pretrained(vpe_model, "VPE2").to("cuda")
65
 
66
  if torch.cuda.is_available():
@@ -234,7 +242,7 @@ with gr.Blocks(css=css, title="ViPer Demo", theme=gr.themes.Base()) as demo:
234
  ]
235
  }
236
 
237
- comments = {'test.png': "Not sure about the concept, it's too straightforward. Though the boy looks kinda creepy which makes it exciting. the art style is pretty to look at. I like that the colors are muted, but wish they were a bit darker to make it more eerie and add depth.", 'comment_images/0.png': "Hate this with a passion. The colors are too vibrant and don't match at all. I hate these colors in general. The patterns are too abstract and contemporary. a 5-year-old could draw this. pass.", 'comment_images/1.png': "Woah I love the art style. The texture feels like old paper which is oh so beautiful. There are so many details to focus on. I love the expressive lines and how busy the composition is. Even though orange isn't my favorite, the greenish blue color of the water is so gorgeous.", 'comment_images/2.png': "I don't like how monochromatic and muted this one is. but the paperish texture is nice and the details are so intricate.", 'comment_images/3.png': "Oh super pretty! Looks so smooth and wet. Love the details and loose lines too. Feels mystical and magical and eerie. Also dark purples and blues? deep indigo? My fav ever. I'm here for it.", 'comment_images/4.png': "Love the art style. The uncanny vibe and nightmarish horror is so cool. Like its horror but if you squint you can't tell? Love the strange. wish it had more colors though. not a fan of greyscale.", 'comment_images/5.png': 'omg I hate this haha. what the hell. everything about it disgusts me so boring and childish ew.', 'comment_images/6.png': 'yessss. give it to the texture give it to the brushstrokes give it to the style. perfect. just wish the colors were less beige and more bold. I want an active nightmare. but kisses to the surrealism.'}
238
  comments = gr.State(dict())
239
 
240
  image_index = gr.State(0)
@@ -709,7 +717,7 @@ with gr.Blocks(css=css, title="ViPer Demo", theme=gr.themes.Base()) as demo:
709
 
710
  with gr.Row():
711
  prompt = gr.Dropdown(
712
- example_prompts, label="Prompt", info="Enter your prompt or choose an example prompts from the dropdown.", allow_custom_value=True, multiselect=False, show_label=False
713
  )
714
 
715
  run_button = gr.Button("Run personalized generation", scale=0, interactive=True, variant="primary")
 
61
  quantization_config=bnb_config,
62
  )
63
 
64
+ vpe_model = PeftModel.from_pretrained(vpe_model, "EPFL-VILAB/VPE-ViPer").to("cuda")
65
+
66
+ vpe_model = AutoModelForVision2Seq.from_pretrained(
67
+ "HuggingFaceM4/idefics2-8b",
68
+ torch_dtype=torch.float16,
69
+ quantization_config=bnb_config,
70
+ )
71
+
72
  vpe_model = PeftModel.from_pretrained(vpe_model, "VPE2").to("cuda")
73
 
74
  if torch.cuda.is_available():
 
242
  ]
243
  }
244
 
245
+ #comments = {'test.png': "Not sure about the concept, it's too straightforward. Though the boy looks kinda creepy which makes it exciting. the art style is pretty to look at. I like that the colors are muted, but wish they were a bit darker to make it more eerie and add depth.", 'comment_images/0.png': "Hate this with a passion. The colors are too vibrant and don't match at all. I hate these colors in general. The patterns are too abstract and contemporary. a 5-year-old could draw this. pass.", 'comment_images/1.png': "Woah I love the art style. The texture feels like old paper which is oh so beautiful. There are so many details to focus on. I love the expressive lines and how busy the composition is. Even though orange isn't my favorite, the greenish blue color of the water is so gorgeous.", 'comment_images/2.png': "I don't like how monochromatic and muted this one is. but the paperish texture is nice and the details are so intricate.", 'comment_images/3.png': "Oh super pretty! Looks so smooth and wet. Love the details and loose lines too. Feels mystical and magical and eerie. Also dark purples and blues? deep indigo? My fav ever. I'm here for it.", 'comment_images/4.png': "Love the art style. The uncanny vibe and nightmarish horror is so cool. Like its horror but if you squint you can't tell? Love the strange. wish it had more colors though. not a fan of greyscale.", 'comment_images/5.png': 'omg I hate this haha. what the hell. everything about it disgusts me so boring and childish ew.', 'comment_images/6.png': 'yessss. give it to the texture give it to the brushstrokes give it to the style. perfect. just wish the colors were less beige and more bold. I want an active nightmare. but kisses to the surrealism.'}
246
  comments = gr.State(dict())
247
 
248
  image_index = gr.State(0)
 
717
 
718
  with gr.Row():
719
  prompt = gr.Dropdown(
720
+ example_prompts, label="Prompt", info="Enter your prompt or choose an example prompt from the dropdown.", allow_custom_value=True, multiselect=False, show_label=False
721
  )
722
 
723
  run_button = gr.Button("Run personalized generation", scale=0, interactive=True, variant="primary")