Adjust parameters and ignore favicon.ico
This commit is contained in:
parent
d55f6163b6
commit
6d7c618a19
8
main.py
8
main.py
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue