Spaces:
Runtime error
Runtime error
Download app.py from bigcode/bot-issues-visualization: direct link, hf CLI and curl.
- Browser
- Download file 929 Bytes
-
https://huggingface.co/spaces/bigcode/bot-issues-visualization/resolve/c2c24875b3915da3a4949de7faa98d21bfaf2d22/app.py
- Command line
-
hf download hf://spaces/bigcode/bot-issues-visualization@c2c24875b3915da3a4949de7faa98d21bfaf2d22/app.py
-
curl -L -o app.py https://huggingface.co/spaces/bigcode/bot-issues-visualization/resolve/c2c24875b3915da3a4949de7faa98d21bfaf2d22/app.py
929 Bytes
| 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: | |
| print("-" * 75) | |
| masked_author = f"masked as {event['masked_author']}" if "masked_author" in event else "" | |
| st.write(f"author: {event['author']} {masked_author}, {event['action']} {event['type']}: {event['title']}") | |
| st.write(f"text: {event['text']}") | |
| samples = load_data() | |
| col1, _ = st.columns([2, 4]) | |
| with col1: | |
| index_example = st.number_input(f"Index of the chosen example from the existing {len(samples)}", min_value=0, max_value=max_docs-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"]) | |