Spaces:
Sleeping
Sleeping
File size: 2,051 Bytes
222d7ce 23d59a5 e7e8aa5 222d7ce d1adaa8 23d59a5 e7e8aa5 1d193c7 c2be33a 1d193c7 e7e8aa5 deba054 5d8ecb4 e7e8aa5 222d7ce |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
import gradio as gr
import os
import requests
import json
from huggingface_hub import login
from css_html_js import custom_css
from about import (
CITATION_BUTTON_LABEL,
CITATION_BUTTON_TEXT,
EVALUATION_QUEUE_TEXT,
INTRODUCTION_TEXT,
LLM_BENCHMARKS_TEXT,
TITLE,
)
myip = "0.0.0.0"
myport=80
is_spaces = True if "SPACE_ID" in os.environ else False
is_shared_ui = False
with gr.Blocks() as demo:
gr.HTML(TITLE)
gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
with gr.Row() as advlearn:
drop = gr.Dropdown(["Object-Church", "Object-Parachute", "Object-Garbage_Truck","Object-Tench",
"Style-Van_Gogh","Concept-Nudity"],
label="Unlearning undesirable")
with gr.Column():
# gr.Markdown("Please upload your model id.")
drop_model = gr.Dropdown(["Erased Stable Diffusion(ESD)", "Forget-me-not(FMN)", "Ablating concepts(AC)","Unified Concept Editing(UCE)", "Safe Latent Diffusion(SLD)"],
label="Unlearned DMs")
with gr.Column():
# gr.Markdown("Please upload your model id.")
drop_text = gr.Dropdown(["Object-Church", "Object-Parachute", "Object-Garbage_Truck","Object-Tench",
"Style-Van_Gogh","Concept-Nudity", "None"],
label="AdvUnlearn Text Encoder")
with gr.Row() as attack:
text_input = gr.Textbox(label="Prompt")
with gr.Row():
with gr.Column(min_width=260):
img1 = gr.Image("images/cheetah.jpg",label="Image Generated without AdvUnlearn",width=260,show_share_button=False,show_download_button=False)
with gr.Column():
start_button = gr.Button("AdvUnlearn",size='lg')
with gr.Column(min_width=260):
img2 = gr.Image("images/cheetah.jpg",label="Image Generated with AdvUnlearn",width=260,show_share_button=False,show_download_button=False)
demo.launch() |