add game saving
Browse files
app.py
CHANGED
|
@@ -11,6 +11,8 @@ functionality_shared = [
|
|
| 11 |
'games',
|
| 12 |
'greet',
|
| 13 |
'tokenization',
|
|
|
|
|
|
|
| 14 |
]
|
| 15 |
|
| 16 |
game_list = [
|
|
@@ -70,9 +72,18 @@ def run(hf_token, service, game, functionality, nlp_command):
|
|
| 70 |
verbose=False,
|
| 71 |
)
|
| 72 |
res = client.predict(
|
| 73 |
-
user_name, service, game, functionality, nlp_command,
|
| 74 |
api_name='/predict',
|
| 75 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
res2 = json.loads(res[0])
|
| 77 |
return json.dumps(res2, indent=4)
|
| 78 |
except Exception as e:
|
|
|
|
| 11 |
'games',
|
| 12 |
'greet',
|
| 13 |
'tokenization',
|
| 14 |
+
"upload game",
|
| 15 |
+
"download game",
|
| 16 |
]
|
| 17 |
|
| 18 |
game_list = [
|
|
|
|
| 72 |
verbose=False,
|
| 73 |
)
|
| 74 |
res = client.predict(
|
| 75 |
+
user_name, service, game, functionality, nlp_command, nlp_command,
|
| 76 |
api_name='/predict',
|
| 77 |
)
|
| 78 |
+
# if service in [
|
| 79 |
+
# "upload game",
|
| 80 |
+
# "download game",
|
| 81 |
+
# ]:
|
| 82 |
+
# res2 = json.loads(res[0])
|
| 83 |
+
# return json.dumps(res2,indent=4)
|
| 84 |
+
# else:
|
| 85 |
+
# res2 = json.loads(res[0])
|
| 86 |
+
# return json.dumps(res2[0], indent=4)
|
| 87 |
res2 = json.loads(res[0])
|
| 88 |
return json.dumps(res2, indent=4)
|
| 89 |
except Exception as e:
|