Update app.py
Browse files
app.py
CHANGED
@@ -25,9 +25,6 @@ functionality_list = [
|
|
25 |
"json",
|
26 |
]
|
27 |
|
28 |
-
# redirect all traffic to the proxy sever
|
29 |
-
space = 'stevez-proxy'
|
30 |
-
|
31 |
def run(hf_token, service, game, functionality, nlp_command):
|
32 |
"""
|
33 |
event handler
|
@@ -38,10 +35,11 @@ def run(hf_token, service, game, functionality, nlp_command):
|
|
38 |
if user_name is None:
|
39 |
user_name = '__fake__'
|
40 |
|
41 |
-
|
|
|
42 |
if redirect is not None:
|
43 |
-
|
44 |
-
|
45 |
if token is None or token == '':
|
46 |
return 'please specify hf token'
|
47 |
|
@@ -63,7 +61,7 @@ def run(hf_token, service, game, functionality, nlp_command):
|
|
63 |
# print(f"{t} [{game:<12}] [{user_name[:12]:<12}] {nlp_command}")
|
64 |
|
65 |
client = Client(
|
66 |
-
|
67 |
hf_token=token,
|
68 |
verbose=False,
|
69 |
)
|
|
|
25 |
"json",
|
26 |
]
|
27 |
|
|
|
|
|
|
|
28 |
def run(hf_token, service, game, functionality, nlp_command):
|
29 |
"""
|
30 |
event handler
|
|
|
35 |
if user_name is None:
|
36 |
user_name = '__fake__'
|
37 |
|
38 |
+
# redirect all traffic to the proxy sever
|
39 |
+
space = 'stevez-proxy'
|
40 |
if redirect is not None:
|
41 |
+
space = redirect
|
42 |
+
|
43 |
if token is None or token == '':
|
44 |
return 'please specify hf token'
|
45 |
|
|
|
61 |
# print(f"{t} [{game:<12}] [{user_name[:12]:<12}] {nlp_command}")
|
62 |
|
63 |
client = Client(
|
64 |
+
f'https://{space}.hf.space',
|
65 |
hf_token=token,
|
66 |
verbose=False,
|
67 |
)
|