Daniel Nichols commited on
Commit
090e2ae
·
1 Parent(s): 8ab167c

fix styling bug

Browse files
Files changed (1) hide show
  1. src/perfguru.py +6 -6
src/perfguru.py CHANGED
@@ -42,8 +42,8 @@ def chat_with_llms(prompt, code_files, profile_file, profile_type):
42
  if response2 is None:
43
  error_helper(f"Failed to get response from {model2.name}. Please try again.")
44
 
45
- source1 = gr.Markdown(f"{model1.name} + {formatter1.name}", visible=False, elem_classes=["not-voted"])
46
- source2 = gr.Markdown(f"{model2.name} + {formatter2.name}", visible=False, elem_classes=["not-voted"])
47
 
48
  # set vote buttons to deactive
49
  vote_buttons = gr.Button(interactive=False), gr.Button(interactive=False), gr.Button(interactive=False), gr.Button(interactive=False)
@@ -86,11 +86,11 @@ def handle_vote(prompt, vote, response1, source1, full_prompt1, response2, sourc
86
  model1, formatter1 = source1.split(" + ")
87
  model2, formatter2 = source2.split(" + ")
88
 
89
- label1_class = "voted" if vote == "Vote for Response 1" else "not-voted"
90
- label2_class = "voted" if vote == "Vote for Response 2" else "not-voted"
91
 
92
  log_interaction(prompt, vote, response1, model1, formatter1, full_prompt1, response2, model2, formatter2, full_prompt2)
93
- return gr.Markdown(visible=True, elem_classes=[label1_class]), gr.Markdown(visible=True, elem_classes=[label2_class]), \
94
  gr.Button(interactive=False), gr.Button(interactive=False), gr.Button(interactive=False), gr.Button(interactive=False)
95
 
96
  # Define the Gradio interface
@@ -161,4 +161,4 @@ with gr.Blocks(css=".not-voted p { color: black; } .voted p { color: green; } .r
161
 
162
  # Launch the Gradio interface
163
  if __name__ == '__main__':
164
- interface.launch()
 
42
  if response2 is None:
43
  error_helper(f"Failed to get response from {model2.name}. Please try again.")
44
 
45
+ source1 = gr.Markdown(f"{model1.name} + {formatter1.name}", visible=False, elem_classes=[])
46
+ source2 = gr.Markdown(f"{model2.name} + {formatter2.name}", visible=False, elem_classes=[])
47
 
48
  # set vote buttons to deactive
49
  vote_buttons = gr.Button(interactive=False), gr.Button(interactive=False), gr.Button(interactive=False), gr.Button(interactive=False)
 
86
  model1, formatter1 = source1.split(" + ")
87
  model2, formatter2 = source2.split(" + ")
88
 
89
+ label1_class = ["voted"] if vote == "Vote for Response 1" else []
90
+ label2_class = ["voted"] if vote == "Vote for Response 2" else []
91
 
92
  log_interaction(prompt, vote, response1, model1, formatter1, full_prompt1, response2, model2, formatter2, full_prompt2)
93
+ return gr.Markdown(visible=True, elem_classes=label1_class), gr.Markdown(visible=True, elem_classes=label2_class), \
94
  gr.Button(interactive=False), gr.Button(interactive=False), gr.Button(interactive=False), gr.Button(interactive=False)
95
 
96
  # Define the Gradio interface
 
161
 
162
  # Launch the Gradio interface
163
  if __name__ == '__main__':
164
+ interface.launch(share=True)