tdurbor commited on
Commit
2e95c9c
·
verified ·
1 Parent(s): 1351893

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -2,8 +2,18 @@ import gradio as gr
2
  import os
3
 
4
  # Check if running on Hugging Face Spaces
5
- is_hf_spaces = os.getenv("HF_SPACES", "false").lower() == "true"
6
- print(is_hf_spaces)
 
 
 
 
 
 
 
 
 
 
7
  def greet(name, intensity):
8
  return "Hello, " + name + "!" * int(intensity)
9
 
 
2
  import os
3
 
4
  # Check if running on Hugging Face Spaces
5
+
6
+ import os
7
+
8
+ def is_running_in_space():
9
+ return "HF_SPACE_ID" in os.environ
10
+
11
+ if is_running_in_space():
12
+ print("Running in Hugging Face Space")
13
+ else:
14
+ print("Running locally")
15
+
16
+
17
  def greet(name, intensity):
18
  return "Hello, " + name + "!" * int(intensity)
19