Spaces:
Sleeping
Sleeping
notbulubula
commited on
Commit
·
cd75d48
1
Parent(s):
1941536
Testing
Browse files- .github/workflows/sync_to_hf_space.yml +20 -0
- app.py +20 -16
.github/workflows/sync_to_hf_space.yml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Sync to Hugging Face hub
|
2 |
+
on:
|
3 |
+
push:
|
4 |
+
branches: [main]
|
5 |
+
|
6 |
+
# to run this workflow manually from the Actions tab
|
7 |
+
workflow_dispatch:
|
8 |
+
|
9 |
+
jobs:
|
10 |
+
sync-to-hub:
|
11 |
+
runs-on: ubuntu-latest
|
12 |
+
steps:
|
13 |
+
- uses: actions/checkout@v3
|
14 |
+
with:
|
15 |
+
fetch-depth: 0
|
16 |
+
lfs: true
|
17 |
+
- name: Push to hub
|
18 |
+
env:
|
19 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
20 |
+
run: git push https://bulubula:[email protected]/spaces/bulubula/DashboardSafeScan main
|
app.py
CHANGED
@@ -2,26 +2,30 @@ import streamlit as st
|
|
2 |
import wandb
|
3 |
import pandas as pd
|
4 |
|
5 |
-
# Initialize W&B API
|
6 |
-
api = wandb.Api()
|
|
|
|
|
|
|
|
|
7 |
|
8 |
# Replace with your W&B entity and project name
|
9 |
-
entity = "urbaniak-bruno-safescanai"
|
10 |
-
project = "pytorch-intro"
|
11 |
|
12 |
-
# Fetch all runs from the project
|
13 |
-
runs = api.runs(f"{entity}/{project}")
|
14 |
|
15 |
-
# Select a specific run (or create a dropdown for the user to select)
|
16 |
-
run = runs[0] # Example: selecting the first run
|
17 |
|
18 |
-
# Fetch the run data as a pandas DataFrame
|
19 |
-
run_df = run.history()
|
20 |
|
21 |
-
# Streamlit UI
|
22 |
-
st.title("W&B Data in Streamlit")
|
23 |
-
st.write(f"Displaying data for run: {run.name}")
|
24 |
-
st.dataframe(run_df)
|
25 |
|
26 |
-
# Example: Plotting a graph from the data
|
27 |
-
st.line_chart(run_df[['epoch', 'accuracy']]) # Replace with appropriate columns
|
|
|
2 |
import wandb
|
3 |
import pandas as pd
|
4 |
|
5 |
+
# # Initialize W&B API
|
6 |
+
# api = wandb.Api()
|
7 |
+
|
8 |
+
# Show anything to see if works
|
9 |
+
st.write("Hello World")
|
10 |
+
|
11 |
|
12 |
# Replace with your W&B entity and project name
|
13 |
+
# entity = "urbaniak-bruno-safescanai"
|
14 |
+
# project = "pytorch-intro"
|
15 |
|
16 |
+
# # Fetch all runs from the project
|
17 |
+
# runs = api.runs(f"{entity}/{project}")
|
18 |
|
19 |
+
# # Select a specific run (or create a dropdown for the user to select)
|
20 |
+
# run = runs[0] # Example: selecting the first run
|
21 |
|
22 |
+
# # Fetch the run data as a pandas DataFrame
|
23 |
+
# run_df = run.history()
|
24 |
|
25 |
+
# # Streamlit UI
|
26 |
+
# st.title("W&B Data in Streamlit")
|
27 |
+
# st.write(f"Displaying data for run: {run.name}")
|
28 |
+
# st.dataframe(run_df)
|
29 |
|
30 |
+
# # Example: Plotting a graph from the data
|
31 |
+
# st.line_chart(run_df[['epoch', 'accuracy']]) # Replace with appropriate columns
|