Spaces:
Sleeping
Sleeping
Beracles
commited on
Commit
·
23586d1
1
Parent(s):
f9d919d
fix string format
Browse files
app.py
CHANGED
|
@@ -110,7 +110,7 @@ def run(hf_token, service, game, functionality, nlp_command):
|
|
| 110 |
)
|
| 111 |
calling_end = beijing()
|
| 112 |
timecost = calling_end.timestamp() - calling_start.timestamp()
|
| 113 |
-
print(f"calling ai ends at {calling_end}, costs
|
| 114 |
outp = json.loads(res)
|
| 115 |
# add proxy version info to the output
|
| 116 |
outp["proxy-version"] = proxy_version
|
|
@@ -121,7 +121,7 @@ def run(hf_token, service, game, functionality, nlp_command):
|
|
| 121 |
app_util.call_logger(outp, identity, token)
|
| 122 |
calling_end = beijing()
|
| 123 |
timecost = calling_end.timestamp() - calling_start.timestamp()
|
| 124 |
-
print(f"calling logger ends at {calling_end}, costs
|
| 125 |
except Exception as e:
|
| 126 |
return (
|
| 127 |
f"{type(e)}, {str(e)}. \nyou may want to make "
|
|
@@ -130,8 +130,8 @@ def run(hf_token, service, game, functionality, nlp_command):
|
|
| 130 |
service_end = beijing()
|
| 131 |
timecost = service_end.timestamp() - service_start.timestamp()
|
| 132 |
print(
|
| 133 |
-
f">>>>>>>>>>>>>>> service ends at {service_end},
|
| 134 |
-
|
| 135 |
)
|
| 136 |
return json.dumps(outp, indent=4)
|
| 137 |
|
|
|
|
| 110 |
)
|
| 111 |
calling_end = beijing()
|
| 112 |
timecost = calling_end.timestamp() - calling_start.timestamp()
|
| 113 |
+
print(f"calling ai ends at {calling_end}, costs {timecost:.2f}s")
|
| 114 |
outp = json.loads(res)
|
| 115 |
# add proxy version info to the output
|
| 116 |
outp["proxy-version"] = proxy_version
|
|
|
|
| 121 |
app_util.call_logger(outp, identity, token)
|
| 122 |
calling_end = beijing()
|
| 123 |
timecost = calling_end.timestamp() - calling_start.timestamp()
|
| 124 |
+
print(f"calling logger ends at {calling_end}, costs {timecost:.2f}s")
|
| 125 |
except Exception as e:
|
| 126 |
return (
|
| 127 |
f"{type(e)}, {str(e)}. \nyou may want to make "
|
|
|
|
| 130 |
service_end = beijing()
|
| 131 |
timecost = service_end.timestamp() - service_start.timestamp()
|
| 132 |
print(
|
| 133 |
+
f">>>>>>>>>>>>>>> service ends at {service_end}, "
|
| 134 |
+
+ f"costs {timecost:.2f} <<<<<<<<<<<<<<<"
|
| 135 |
)
|
| 136 |
return json.dumps(outp, indent=4)
|
| 137 |
|