Spaces:
Sleeping
Sleeping
zsolnai commited on
Commit ·
91d11d8
1
Parent(s): 64c7ca2
feat(ui): add json reading ui
Browse files- app.py +30 -0
- predictions.json +55 -0
- requirements.txt +2 -0
app.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import streamlit as st
|
| 6 |
+
|
| 7 |
+
st.set_page_config(page_title="GitHub Trend Predictor", page_icon="📈")
|
| 8 |
+
st.title("📈 GitHub Trend Predictions")
|
| 9 |
+
|
| 10 |
+
# Path to the file pushed by your GitHub Action
|
| 11 |
+
file_path = "predictions.json"
|
| 12 |
+
|
| 13 |
+
if os.path.exists(file_path):
|
| 14 |
+
with open(file_path, "r") as f:
|
| 15 |
+
data = json.load(f)
|
| 16 |
+
|
| 17 |
+
st.success(f"Last updated: {os.path.getmtime(file_path)}")
|
| 18 |
+
|
| 19 |
+
# Display as a searchable/sortable table if it's a list
|
| 20 |
+
if isinstance(data, list):
|
| 21 |
+
df = pd.DataFrame(data)
|
| 22 |
+
st.dataframe(df, use_container_width=True)
|
| 23 |
+
else:
|
| 24 |
+
# Fallback for nested JSON
|
| 25 |
+
st.json(data)
|
| 26 |
+
else:
|
| 27 |
+
st.info("Waiting for the first data sync from GitHub...")
|
| 28 |
+
st.image(
|
| 29 |
+
"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/wait.png"
|
| 30 |
+
)
|
predictions.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"prediction_date": "2026-01-01",
|
| 3 |
+
"predictions": [
|
| 4 |
+
{
|
| 5 |
+
"repo_name": "BloopAI/vibe-kanban",
|
| 6 |
+
"language": "Rust",
|
| 7 |
+
"probability": 0.9538549780845642
|
| 8 |
+
},
|
| 9 |
+
{
|
| 10 |
+
"repo_name": "sansan0/TrendRadar",
|
| 11 |
+
"language": "Python",
|
| 12 |
+
"probability": 0.8954059481620789
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"repo_name": "harvard-edge/cs249r_book",
|
| 16 |
+
"language": "JavaScript",
|
| 17 |
+
"probability": 0.7897142767906189
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
"repo_name": "resemble-ai/chatterbox",
|
| 21 |
+
"language": "Python",
|
| 22 |
+
"probability": 0.6127614974975586
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"repo_name": "organicmaps/organicmaps",
|
| 26 |
+
"language": "C++",
|
| 27 |
+
"probability": 0.4753268361091614
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
"repo_name": "afkarxyz/SpotiFLAC",
|
| 31 |
+
"language": "TypeScript",
|
| 32 |
+
"probability": 0.44384217262268066
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"repo_name": "openai/openai-cookbook",
|
| 36 |
+
"language": "Jupyter Notebook",
|
| 37 |
+
"probability": 0.36722928285598755
|
| 38 |
+
},
|
| 39 |
+
{
|
| 40 |
+
"repo_name": "nocodb/nocodb",
|
| 41 |
+
"language": "TypeScript",
|
| 42 |
+
"probability": 0.21901018917560577
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"repo_name": "google-gemini/computer-use-preview",
|
| 46 |
+
"language": "Python",
|
| 47 |
+
"probability": 0.18872903287410736
|
| 48 |
+
},
|
| 49 |
+
{
|
| 50 |
+
"repo_name": "timescale/pg-aiguide",
|
| 51 |
+
"language": "Python",
|
| 52 |
+
"probability": 0.04608581215143204
|
| 53 |
+
}
|
| 54 |
+
]
|
| 55 |
+
}
|
requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
streamlit
|
| 2 |
+
pandas
|