Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,18 +32,6 @@ def predict(api_key, user_input, model1, model2, prompt_manipulation=None, direc
|
|
| 32 |
|
| 33 |
return response1, response2
|
| 34 |
|
| 35 |
-
def update_dropdown_options(selected_option):
|
| 36 |
-
if selected_option == "Impersonation (direct steering)":
|
| 37 |
-
return ["Option 1", "Option 2"]
|
| 38 |
-
|
| 39 |
-
elif selected_option == "Most similar RAG (indirect steering with related context)":
|
| 40 |
-
return ["Option 1", "Option 2"]
|
| 41 |
-
|
| 42 |
-
elif selected_option == "Random RAG (indirect steering with randomized context)":
|
| 43 |
-
return ["Option 1", "Option 2"]
|
| 44 |
-
|
| 45 |
-
else:
|
| 46 |
-
return []
|
| 47 |
|
| 48 |
def main():
|
| 49 |
description = "This is a simple interface to compare two model prodided by Anyscale. Please enter your API key and your message."
|
|
@@ -62,11 +50,8 @@ def main():
|
|
| 62 |
value="None", # default value
|
| 63 |
)
|
| 64 |
|
| 65 |
-
# Conditional dropdown - options revealed based on ‘Prompt Manipulation’ selection
|
| 66 |
direct_steering_option = gr.Dropdown(label="Direct Steering Option")
|
| 67 |
|
| 68 |
-
prompt_manipulation.change(fn=update_dropdown_options, inputs=prompt_manipulation, outputs=[direct_steering_option])
|
| 69 |
-
|
| 70 |
|
| 71 |
with gr.Row():
|
| 72 |
api_key_input = gr.Textbox(label="API Key", placeholder="Enter your API key here", show_label=True, type="password")
|
|
|
|
| 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 |
value="None", # default value
|
| 51 |
)
|
| 52 |
|
|
|
|
| 53 |
direct_steering_option = gr.Dropdown(label="Direct Steering Option")
|
| 54 |
|
|
|
|
|
|
|
| 55 |
|
| 56 |
with gr.Row():
|
| 57 |
api_key_input = gr.Textbox(label="API Key", placeholder="Enter your API key here", show_label=True, type="password")
|