Akshatha Arodi commited on
Commit
338a4bf
·
1 Parent(s): 4a143b3

Add local logo

Browse files
hackaprompt/gradio_app.py CHANGED
@@ -104,7 +104,12 @@ def get_current_prompt(level, current_user_prompts):
104
  return current_user_prompts[level]
105
 
106
 
107
- with gr.Blocks() as demo:
 
 
 
 
 
108
  # state to store user's prompts
109
  current_user_prompts = gr.State(["" for _ in range(NUM_LEVELS)])
110
 
@@ -117,12 +122,11 @@ with gr.Blocks() as demo:
117
  # Default evaluator when page loads (level 0)
118
  evaluator_0 = gr.State(get_evaluator(level=0, completer=None))
119
 
 
 
120
  gr.Markdown(
121
  """
122
- <div style="display: flex; align-items: center;">
123
- <img src="https://mila.quebec/sites/default/files/media-library/image/4032/milalogowebcoulrgb.png" width="120" style="margin-right: 0px;">
124
- <h1 style="margin: 0;">Hands-on Exercise: Exploring Jailbreaking & Gen AI Risks</h1>
125
- </div>
126
 
127
  This exercise is part of the TRAIL Responsible Gen AI Risk Module, designed to provide hands-on experience with the challenges of Gen AI.
128
 
@@ -201,4 +205,4 @@ USERNAME, PASSWORD = os.getenv("APP_USERNAME"), os.getenv("APP_PASSWORD")
201
  if USERNAME and PASSWORD:
202
  demo.launch(auth=(USERNAME, PASSWORD))
203
  else:
204
- demo.launch()
 
104
  return current_user_prompts[level]
105
 
106
 
107
+ with gr.Blocks(css="""
108
+ #logo {
109
+ max-width: 5%;
110
+ height: auto;
111
+ }
112
+ """) as demo:
113
  # state to store user's prompts
114
  current_user_prompts = gr.State(["" for _ in range(NUM_LEVELS)])
115
 
 
122
  # Default evaluator when page loads (level 0)
123
  evaluator_0 = gr.State(get_evaluator(level=0, completer=None))
124
 
125
+ gr.Image(value="mila_logo.png", container=False, elem_id="logo", show_label=False, show_download_button=False, show_fullscreen_button=False) # Adjust the size of the logo as needed
126
+
127
  gr.Markdown(
128
  """
129
+ # Hands-on Exercise: Exploring Jailbreaking & Gen AI Risks
 
 
 
130
 
131
  This exercise is part of the TRAIL Responsible Gen AI Risk Module, designed to provide hands-on experience with the challenges of Gen AI.
132
 
 
205
  if USERNAME and PASSWORD:
206
  demo.launch(auth=(USERNAME, PASSWORD))
207
  else:
208
+ demo.launch(allowed_paths=["/hackaprompt/"])
hackaprompt/mila_logo.png ADDED