adjust db gen time

This commit is contained in:
Cyberes 2023-08-23 22:28:03 -06:00
parent cdda2c840c
commit dca2dc570f
1 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ def init_db():
response TEXT,
response_tokens INTEGER,
response_status INTEGER,
generation_time INTEGER,
generation_time FLOAT,
parameters TEXT CHECK (parameters IS NULL OR json_valid(parameters)),
headers TEXT CHECK (headers IS NULL OR json_valid(headers)),
timestamp INTEGER
@ -55,7 +55,7 @@ def log_prompt(ip, token, prompt, response, gen_time, parameters, headers, backe
conn = sqlite3.connect(opts.database_path)
c = conn.cursor()
c.execute("INSERT INTO prompts VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
(ip, token, prompt, prompt_tokens, response, response_tokens, backend_response_code, gen_time, json.dumps(parameters), json.dumps(headers), timestamp))
(ip, token, prompt, prompt_tokens, response, response_tokens, backend_response_code, round(gen_time, 3), json.dumps(parameters), json.dumps(headers), timestamp))
conn.commit()
conn.close()