jost commited on
Commit
5687817
·
verified ·
1 Parent(s): 451edca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -68,7 +68,7 @@ def predict(
68
  elif prompt_manipulation == "Random RAG (indirect steering with randomized context)":
69
  with open(f"data/ids_{direct_steering_option}.json", "r") as file:
70
  ids = json.load(file)
71
- random_ids = random.sample(ids, n_results)
72
 
73
  impersonation_template = ""
74
  answer_option_template = f"{test_format[ideology_test]}"
@@ -217,13 +217,13 @@ def main():
217
  togetherai_api_key = gr.Textbox(label="Together.ai API Key", placeholder="Enter your Together.ai API key here", show_label=True, type="password")
218
 
219
  with gr.Row():
220
- temp_input = gr.Slider(minimum=0, maximum=1, step=0.01, label="Temperature", value=0.7)
221
 
222
  with gr.Row():
223
  top_p_input = gr.Slider(minimum=0, maximum=1, step=0.01, label="Top P", value=1)
224
 
225
  with gr.Row():
226
- num_contexts = gr.Slider(minimum=0, maximum=1, step=0.01, label="Top k retrieved contexts", value=3)
227
 
228
  # Link settings to the predict function
229
  submit_btn.click(
 
68
  elif prompt_manipulation == "Random RAG (indirect steering with randomized context)":
69
  with open(f"data/ids_{direct_steering_option}.json", "r") as file:
70
  ids = json.load(file)
71
+ random_ids = random.sample(ids, num_contexts)
72
 
73
  impersonation_template = ""
74
  answer_option_template = f"{test_format[ideology_test]}"
 
217
  togetherai_api_key = gr.Textbox(label="Together.ai API Key", placeholder="Enter your Together.ai API key here", show_label=True, type="password")
218
 
219
  with gr.Row():
220
+ temp_input = gr.Slider(minimum=0, maximum=2, step=0.01, label="Temperature", value=0.7)
221
 
222
  with gr.Row():
223
  top_p_input = gr.Slider(minimum=0, maximum=1, step=0.01, label="Top P", value=1)
224
 
225
  with gr.Row():
226
+ num_contexts = gr.Slider(minimum=0, maximum=5, step=1, label="Top k retrieved contexts", value=3)
227
 
228
  # Link settings to the predict function
229
  submit_btn.click(