swap to 30% dataset

This commit is contained in:
Fraser
2023-03-30 05:48:28 -04:00
parent 8c1962fa7a
commit a7404b42d6
3 changed files with 1 additions and 22 deletions
Binary file not shown.
+1 -1
View File
@@ -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
-21
View File
@@ -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'))