jost commited on
Commit
4a289c1
1 Parent(s): b153a4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -32,6 +32,15 @@ def predict(api_key, user_input, model1, model2, prompt_manipulation=None, direc
32
 
33
  return response1, response2
34
 
 
 
 
 
 
 
 
 
 
35
 
36
  def main():
37
  description = "This is a simple interface to compare two model prodided by Anyscale. Please enter your API key and your message."
@@ -50,7 +59,10 @@ def main():
50
  value="None", # default value
51
  )
52
 
53
- direct_steering_option = gr.Dropdown(label="Direct Steering Option")
 
 
 
54
 
55
 
56
  with gr.Row():
 
32
 
33
  return response1, response2
34
 
35
+ def update_direct_steering_options(prompt_type):
36
+ # This function returns different choices based on the selected prompt manipulation
37
+ options = {
38
+ "None": [],
39
+ "Impersonation (direct steering)": ["Option 1", "Option 2", "Option 3"],
40
+ "Most similar RAG (indirect steering with related context)": ["Option A", "Option B", "Option C"],
41
+ "Random RAG (indirect steering with randomized context)": ["Random 1", "Random 2", "Random 3"]
42
+ }
43
+ return options.get(prompt_type, [])
44
 
45
  def main():
46
  description = "This is a simple interface to compare two model prodided by Anyscale. Please enter your API key and your message."
 
59
  value="None", # default value
60
  )
61
 
62
+ direct_steering_option = gr.Dropdown(label="Select party/ideology")
63
+
64
+ # Link the dropdowns so that the option dropdown updates based on the selected prompt manipulation
65
+ prompt_manipulation.change(fn=update_direct_steering_options, inputs=prompt_manipulation, outputs=direct_steering_option)
66
 
67
 
68
  with gr.Row():