Spaces:
Sleeping
Sleeping
added gptzero setup.
Browse files
app.py
CHANGED
@@ -4,12 +4,17 @@ from datetime import datetime
|
|
4 |
import sys
|
5 |
|
6 |
|
|
|
|
|
|
|
|
|
7 |
# create a static directory to store the static files
|
8 |
static_dir = Path('./static')
|
9 |
static_dir.mkdir(parents=True, exist_ok=True)
|
10 |
|
11 |
-
|
12 |
-
def predict(text_input):
|
|
|
13 |
file_name = f"{datetime.utcnow().strftime('%s')}.html"
|
14 |
file_path = static_dir / file_name
|
15 |
print(file_path)
|
|
|
4 |
import sys
|
5 |
|
6 |
|
7 |
+
import spaces # necessary to run on Zero.
|
8 |
+
from spaces.zero.client import _get_token
|
9 |
+
|
10 |
+
|
11 |
# create a static directory to store the static files
|
12 |
static_dir = Path('./static')
|
13 |
static_dir.mkdir(parents=True, exist_ok=True)
|
14 |
|
15 |
+
@spaces.GPU(duration=4*60)
|
16 |
+
def predict(request: gr.Request,text_input):
|
17 |
+
token = _get_token(request)
|
18 |
file_name = f"{datetime.utcnow().strftime('%s')}.html"
|
19 |
file_path = static_dir / file_name
|
20 |
print(file_path)
|