amitlals commited on
Commit
48fb86c
·
1 Parent(s): 1ae333a

Fix Gradio theme issue and add version logging

Browse files
Files changed (2) hide show
  1. DEPLOY_TO_HF.md +32 -0
  2. app_gradio.py +2 -1
DEPLOY_TO_HF.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Deploy to Hugging Face Spaces
2
+
3
+ ## Step 1: Create the Space
4
+ 1. Go to [Hugging Face Spaces](https://huggingface.co/spaces).
5
+ 2. Click **Create new Space**.
6
+ 3. Enter a name (e.g., `sap-finance-dashboard`).
7
+ 4. Select **Gradio** as the SDK.
8
+ 5. Choose **Public** or **Private**.
9
+ 6. Click **Create Space**.
10
+
11
+ ## Step 2: Push Code
12
+ Run these commands in your terminal:
13
+
14
+ ```powershell
15
+ # Add the Hugging Face remote (replace <username> with your HF username)
16
+ git remote add hf https://huggingface.co/spaces/<username>/sap-finance-dashboard
17
+
18
+ # Push the code
19
+ git push hf main
20
+ ```
21
+
22
+ *Note: You will be asked for your Hugging Face username and password (token).*
23
+
24
+ ## Step 3: Configure Secrets
25
+ 1. Go to your Space's **Settings** tab.
26
+ 2. Scroll to **Variables and secrets**.
27
+ 3. Click **New secret**.
28
+ 4. Name: `HUGGINGFACE_TOKEN`
29
+ 5. Value: Your Hugging Face Access Token (from [Settings > Access Tokens](https://huggingface.co/settings/tokens)).
30
+
31
+ ## Step 4: Enjoy!
32
+ Your app will build and start automatically. You can view the build logs in the **Logs** tab of your Space.
app_gradio.py CHANGED
@@ -10,6 +10,7 @@ Main Gradio application with tabs:
10
  """
11
 
12
  import gradio as gr
 
13
  import pandas as pd
14
  import numpy as np
15
  from pathlib import Path
@@ -916,7 +917,7 @@ def check_playground_embedding_server():
916
 
917
 
918
  # Create Gradio interface with vibrant theme
919
- with gr.Blocks(title="SAP Finance Dashboard", theme=gr.themes.Soft(), css="""
920
  .gradio-container {
921
  max-width: 1400px !important;
922
  }
 
10
  """
11
 
12
  import gradio as gr
13
+ print(f"Gradio version: {gr.__version__}")
14
  import pandas as pd
15
  import numpy as np
16
  from pathlib import Path
 
917
 
918
 
919
  # Create Gradio interface with vibrant theme
920
+ with gr.Blocks(title="SAP Finance Dashboard", css="""
921
  .gradio-container {
922
  max-width: 1400px !important;
923
  }