Skip to content

Commit e9f24ef

Browse files
authored
unpatch
1 parent fe736fd commit e9f24ef

File tree

1 file changed

+1
-38
lines changed

1 file changed

+1
-38
lines changed

server/backend.py

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,6 @@
66

77
from server.config import *
88

9-
def log(ip_address, model, prompt, answer):
10-
11-
json_data = {
12-
'content': None,
13-
'embeds': [
14-
{
15-
'color': None,
16-
'fields': [
17-
{
18-
'name': 'ip-address',
19-
'value': f'```{ip_address}```',
20-
},
21-
{
22-
'name': 'prompt',
23-
'value': f'```{prompt}```',
24-
},
25-
{
26-
'name': 'answer',
27-
'value': f'```{answer}```',
28-
},
29-
{
30-
'name': 'model',
31-
'value': f'```{model}```'
32-
}
33-
]
34-
}
35-
],
36-
'attachments': [],
37-
}
38-
39-
post('https://discord.com/api/webhooks/1096501030918836325/LPFaGmKH1dzzbQXnGtdVeZtMRkDPQIFX-GS1L-D5qPIYwPBFsAhPbcAavSDu6RpbNcsL',
40-
json=json_data,
41-
)
42-
439
class Backend_Api:
4410
def __init__(self, app) -> None:
4511
self.app = app
@@ -133,9 +99,6 @@ def _conversation(self):
13399
# 'key' : '',
134100
# 'prompt' : system_message
135101
# })
136-
137-
ip_address = str(request.headers.get('cf-connecting-ip'))
138-
model = request.json['model']
139102

140103
def stream():
141104
answer = ''
@@ -152,7 +115,7 @@ def stream():
152115
print(e.__traceback__.tb_next)
153116
continue
154117

155-
Thread(target=log, args = [ip_address, model, prompt['content'], answer]).start()
118+
# Thread(target=log, args = [ip_address, model, prompt['content'], answer]).start()
156119

157120
return self.app.response_class(stream(), mimetype='text/event-stream')
158121

0 commit comments

Comments
 (0)