Adjust parameters and ignore favicon.ico

This commit is contained in:
Anthony Wang 2022-07-15 17:17:37 -05:00
parent d55f6163b6
commit 6d7c618a19
Signed by: a
GPG key ID: BC96B00AEC5F2D76

View file

@ -19,13 +19,17 @@ class UnixHTTPServer(UnixStreamServer):
class textgenHandler(BaseHTTPRequestHandler):
def do_GET(self):
def do_GET(self):
prompt = unquote(self.path[1:])
print('Prompt')
print(prompt)
if prompt == 'favicon.ico':
return
input = tokenizer.encode(prompt, return_tensors='pt').to('cuda')
output = tokenizer.decode(model.generate(
input, do_sample=True, max_length=1000, top_p=0.9)[0])
input, do_sample=True, max_length=500, top_p=0.9)[0])
print(output)
self.send_response(200)