Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,18 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
# Define a function to respond to user input
|
4 |
def respond(message, history):
|
|
|
1 |
import gradio as gr
|
2 |
+
import os
|
3 |
+
if os.environ.get("SPACES_ZERO_GPU") is not None:
|
4 |
+
import spaces
|
5 |
+
else:
|
6 |
+
class spaces:
|
7 |
+
@staticmethod
|
8 |
+
def GPU(func):
|
9 |
+
def wrapper(*args, **kwargs):
|
10 |
+
return func(*args, **kwargs)
|
11 |
+
return wrapper
|
12 |
+
|
13 |
+
@spaces.GPU
|
14 |
+
def fake_gpu():
|
15 |
+
pass
|
16 |
|
17 |
# Define a function to respond to user input
|
18 |
def respond(message, history):
|