Merge pull request #1 from east-and-west-magic/fix-proxy
Browse files
app.py
CHANGED
|
@@ -25,8 +25,8 @@ functionality_list = [
|
|
| 25 |
"json",
|
| 26 |
]
|
| 27 |
|
| 28 |
-
#
|
| 29 |
-
space = 'stevez-
|
| 30 |
|
| 31 |
def run(hf_token, service, game, functionality, nlp_command):
|
| 32 |
"""
|
|
@@ -60,19 +60,6 @@ def run(hf_token, service, game, functionality, nlp_command):
|
|
| 60 |
t = t.astimezone(ZoneInfo('Asia/Shanghai'))
|
| 61 |
t = t.replace(microsecond=0)
|
| 62 |
print(f"{t} [{game:<12}] [{user_name[:12]:<12}] {nlp_command}")
|
| 63 |
-
# myobj = {
|
| 64 |
-
# 'data': [service, game, r, nlp_command],
|
| 65 |
-
# }
|
| 66 |
-
# myauth = ('Bearer', hf_token)
|
| 67 |
-
# x = requests.post(
|
| 68 |
-
# url,
|
| 69 |
-
# auth = myauth,
|
| 70 |
-
# json = myobj,
|
| 71 |
-
# )
|
| 72 |
-
# print(f"x: {x}")
|
| 73 |
-
# x2 = json.loads(x.text)
|
| 74 |
-
# res = x2['data'][0]
|
| 75 |
-
# res2 = json.loads(res)
|
| 76 |
|
| 77 |
client = Client(
|
| 78 |
url,
|
|
|
|
| 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 |
"""
|
|
|
|
| 60 |
t = t.astimezone(ZoneInfo('Asia/Shanghai'))
|
| 61 |
t = t.replace(microsecond=0)
|
| 62 |
print(f"{t} [{game:<12}] [{user_name[:12]:<12}] {nlp_command}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
client = Client(
|
| 65 |
url,
|