Spaces:
Runtime error
Runtime error
Download app.py from bigcode/bot-issues-visualization: direct link, hf CLI and curl.
- Browser
- Download file 1 kB
-
https://huggingface.co/spaces/bigcode/bot-issues-visualization/resolve/main/app.py
- Command line
-
hf download hf://spaces/bigcode/bot-issues-visualization/app.py
-
curl -L -o app.py https://huggingface.co/spaces/bigcode/bot-issues-visualization/resolve/main/app.py
1 kB
| import streamlit as st | |
| import json | |
| from datasets import load_dataset | |
| st.set_page_config(page_title="Bot Issues", layout="wide") | |
| st.title("Bot Issues") | |
| def load_data(): | |
| ds = load_dataset("loubnabnl/bot_issues", split="train") | |
| return ds | |
| def print_issue(events): | |
| for event in events: | |
| st.markdown("""---""") | |
| masked_author = f"masked as {event['masked_author']}" if "masked_author" in event else "" | |
| st.markdown(f"**Author:** {event['author']} {masked_author}, {event['action']} {event['type']} with title: {event['title']}") | |
| st.markdown("Text:") | |
| st.code(f"{event['text']}", language="html") | |
| samples = load_data() | |
| col1, _ = st.columns([2, 4]) | |
| with col1: | |
| index_example = st.number_input(f"Index of the chosen conversation from the existing {len(samples)}", min_value=0, max_value=len(samples)-1, value=0, step=1) | |
| st.write(f"Issue size: {samples[index_example]['text_size_bots']}\n\n") | |
| print_issue(samples[index_example]["old_events"]) | |