Dacho688 commited on
Commit
c928bc7
·
1 Parent(s): 9ae24d1

Sync to HF action yaml

Browse files
Files changed (2) hide show
  1. .github/workflows/sync_to_hf.yaml +22 -0
  2. app/app.py +2 -2
.github/workflows/sync_to_hf.yaml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ HF_USERNAME: ${{ vars.HF_USERNAME }}
21
+ HF_SPACE_NAME: ${{ vars.HF_SPACE_NAME}}
22
+ run: git push https://$HF_USERNAME:${HF_TOKEN}@huggingface.co/spaces/${HF_USERNAME}/${HF_SPACE_NAME} main
app/app.py CHANGED
@@ -70,7 +70,7 @@ class BokehApp:
70
  self.doc.add_next_tick_callback(partial(self.update_plot, new_data))
71
  time.sleep(1)
72
 
73
- print("Background thread is shutting down gracefully.")
74
 
75
  def update_plot(self, new_data):
76
  """
@@ -84,7 +84,7 @@ class BokehApp:
84
  """
85
  Callback function that runs when a user closes the document.
86
  """
87
- print(f"Session {session_context.id} destroyed. Stopping background thread.\n", flush=True)
88
  self.stop_event.set()
89
 
90
  # Create an instance of the class when the script is run by the Bokeh server
 
70
  self.doc.add_next_tick_callback(partial(self.update_plot, new_data))
71
  time.sleep(1)
72
 
73
+ print("Background thread is shutting down gracefully.", flush=True)
74
 
75
  def update_plot(self, new_data):
76
  """
 
84
  """
85
  Callback function that runs when a user closes the document.
86
  """
87
+ print(f"Session {session_context.id} destroyed. Stopping background thread.", flush=True)
88
  self.stop_event.set()
89
 
90
  # Create an instance of the class when the script is run by the Bokeh server