Beracles
commited on
Commit
·
5711245
1
Parent(s):
5fca651
use pgsoft.pgconst
Browse files
app.py
CHANGED
@@ -8,33 +8,12 @@ import gradio as gr
|
|
8 |
from gradio_client import Client
|
9 |
from extract import extract
|
10 |
import app_util
|
|
|
11 |
|
12 |
#######################
|
13 |
# proxy version
|
14 |
#######################
|
15 |
-
proxy_version = "1.0.0-2023-
|
16 |
-
|
17 |
-
|
18 |
-
functionality_shared = [
|
19 |
-
"games",
|
20 |
-
"greet",
|
21 |
-
"tokenization",
|
22 |
-
"upload game",
|
23 |
-
"download game",
|
24 |
-
"list games",
|
25 |
-
]
|
26 |
-
|
27 |
-
game_list = [
|
28 |
-
"angry birds",
|
29 |
-
"snake",
|
30 |
-
]
|
31 |
-
|
32 |
-
functionality_list = [
|
33 |
-
"AI",
|
34 |
-
"functionality",
|
35 |
-
"json dedup",
|
36 |
-
"json",
|
37 |
-
]
|
38 |
|
39 |
t = datetime.now()
|
40 |
t = t.astimezone(ZoneInfo("Asia/Shanghai"))
|
@@ -78,7 +57,7 @@ def run(hf_token, service, game, functionality, nlp_command):
|
|
78 |
if token is None or token == "":
|
79 |
return "please specify hf token"
|
80 |
|
81 |
-
if service not in
|
82 |
if game is None:
|
83 |
return "please specify which game"
|
84 |
if functionality is None:
|
@@ -109,7 +88,7 @@ def run(hf_token, service, game, functionality, nlp_command):
|
|
109 |
return json.dumps(outp)
|
110 |
|
111 |
try:
|
112 |
-
if service not in
|
113 |
t = datetime.now()
|
114 |
t = t.astimezone(ZoneInfo("Asia/Shanghai"))
|
115 |
# t = t.replace(microsecond=0)
|
@@ -144,8 +123,8 @@ demo = gr.Interface(
|
|
144 |
inputs=[
|
145 |
"text",
|
146 |
gr.Radio(
|
147 |
-
|
148 |
-
value=
|
149 |
info="Shared services",
|
150 |
),
|
151 |
gr.Radio(
|
|
|
8 |
from gradio_client import Client
|
9 |
from extract import extract
|
10 |
import app_util
|
11 |
+
from pgsoft.pgconst.const import service_list, functionality_list, game_list
|
12 |
|
13 |
#######################
|
14 |
# proxy version
|
15 |
#######################
|
16 |
+
proxy_version = "1.0.0-2023-12-01-a" # use pgconst
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
t = datetime.now()
|
19 |
t = t.astimezone(ZoneInfo("Asia/Shanghai"))
|
|
|
57 |
if token is None or token == "":
|
58 |
return "please specify hf token"
|
59 |
|
60 |
+
if service not in service_list[1:]:
|
61 |
if game is None:
|
62 |
return "please specify which game"
|
63 |
if functionality is None:
|
|
|
88 |
return json.dumps(outp)
|
89 |
|
90 |
try:
|
91 |
+
if service not in service_list[1:]:
|
92 |
t = datetime.now()
|
93 |
t = t.astimezone(ZoneInfo("Asia/Shanghai"))
|
94 |
# t = t.replace(microsecond=0)
|
|
|
123 |
inputs=[
|
124 |
"text",
|
125 |
gr.Radio(
|
126 |
+
service_list,
|
127 |
+
value=service_list[0],
|
128 |
info="Shared services",
|
129 |
),
|
130 |
gr.Radio(
|
req.txt
CHANGED
@@ -57,3 +57,4 @@ tzdata==2023.3
|
|
57 |
urllib3==2.0.6
|
58 |
uvicorn==0.23.2
|
59 |
websockets==11.0.3
|
|
|
|
57 |
urllib3==2.0.6
|
58 |
uvicorn==0.23.2
|
59 |
websockets==11.0.3
|
60 |
+
git+https://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@github.com/east-and-west-magic/pgsoft.git@tag-2023-12-01-a
|