Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -2,8 +2,18 @@ import gradio as gr
|
|
2 |
import os
|
3 |
|
4 |
# Check if running on Hugging Face Spaces
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|