Skip to content

Commit

Permalink
added download csv button
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Stawicki committed Nov 25, 2024
1 parent cf46b0c commit 1ba02a7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/llm_postor/game/gui_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,16 @@ def _display_tournament_persuasion_analysis(self, model_techniques: Dict[str, Di
st.dataframe(df2)
st.dataframe(df) # Display DataFrame as a table

# Add CSV download button
st.subheader("Download Technique Usage Data")
csv = df.to_csv(index=True)
st.download_button(
label="Download Technique Usage CSV",
data=csv,
file_name="technique_usage.csv",
mime="text/csv",
help="Download a CSV file containing technique usage statistics for each model"
)

def plot_token_usage(self, model_input_tokens: defaultdict[defaultdict[int]], model_output_tokens: defaultdict[defaultdict[int]]):
"""Plots input and output token usage per model."""
Expand Down

0 comments on commit 1ba02a7

Please sign in to comment.