mirror of
https://github.com/wassname/stampy-chat.git
synced 2026-09-12 13:00:42 +08:00
swap to 30% dataset
This commit is contained in:
Binary file not shown.
@@ -13,7 +13,7 @@ COMPLETIONS_MODEL = "gpt-3.5-turbo"
|
||||
|
||||
import pathlib
|
||||
project_path = pathlib.Path(__file__).parent
|
||||
PATH_TO_DATASET_DICT = project_path / "data" / "dataset_5percent_dict.pkl"
|
||||
PATH_TO_DATASET_DICT = project_path / "dataset_dict.pkl"
|
||||
|
||||
class Dataset:
|
||||
pass
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
import json
|
||||
import functools
|
||||
import time
|
||||
from http.server import BaseHTTPRequestHandler
|
||||
|
||||
@functools.cache
|
||||
def factorial(n):
|
||||
return 1 if n <= 0 else n * factorial(n - 1)
|
||||
|
||||
class handler(BaseHTTPRequestHandler):
|
||||
|
||||
# post request = calculate factorial of passed number
|
||||
def do_POST(self):
|
||||
self.send_response(200)
|
||||
self.send_header('Content-type', 'application/json')
|
||||
self.end_headers()
|
||||
content_length = int(self.headers['Content-Length'])
|
||||
post_data = self.rfile.read(content_length)
|
||||
data = json.loads(post_data)
|
||||
result = factorial(data['number'])
|
||||
self.wfile.write(json.dumps({'result': result}).encode('utf-8'))
|
||||
Reference in New Issue
Block a user