Skip to content

Commit

Permalink
Fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonOsika committed Jun 3, 2023
1 parent 65a5bab commit 1c0747f
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions scripts/rerun_edited_message_logs.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import json
import os
import pathlib
from typing import Optional
import openai
from chat_to_files import to_files
from ai import AI
from steps import STEPS
from db import DB, DBs

import typer

from ..ai import AI
from ..chat_to_files import to_files

app = typer.Typer()

Expand All @@ -20,17 +16,12 @@ def chat(
model: str = "gpt-4",
temperature: float = 0.1,
max_tokens: int = 4096,
n: int = 1,
stream: bool = True,
):


ai = AI(
model=model, temperature=temperature,
model=model,
temperature=temperature,
max_tokens=max_tokens,
n=n,
stream=stream,
stop=None,
)

with open(messages_path) as f:
Expand All @@ -39,9 +30,9 @@ def chat(
messages = ai.next(messages)

if out_path:
to_files(messages[-1]['content'], out_path)
with open(pathlib.Path(out_path) / 'all_output.txt', 'w') as f:
json.dump(messages[-1]['content'], f)
to_files(messages[-1]["content"], out_path)
with open(pathlib.Path(out_path) / "all_output.txt", "w") as f:
json.dump(messages[-1]["content"], f)


if __name__ == "__main__":
Expand Down

0 comments on commit 1c0747f

Please sign in to comment.