mirror of
https://github.com/Paillat-dev/FABLE.git
synced 2026-01-02 01:06:20 +00:00
feat(video.py): add support for script_prompt.txt file to customize script prompts
fix(script.py): add prompt parameter to generate_script function feat(main.py): add loop to run main function indefinitely and add option to quit with ctrl+c
This commit is contained in:
@@ -35,7 +35,15 @@ class Video:
|
||||
os.remove(os.path.join( self.path, "script.json"))
|
||||
|
||||
if not os.path.exists(os.path.join( self.path, "script.json")):
|
||||
script = await generate_script(self.idea['title'], self.idea['description'])
|
||||
script_prompt = None
|
||||
if os.path.exists(os.path.join(self.parent.path, "script_prompt.txt")):
|
||||
with open(os.path.join(self.parent.path, "script_prompt.txt"), "r") as f:
|
||||
script_prompt = f.read()
|
||||
f.close()
|
||||
if script_prompt:
|
||||
script = await generate_script(self.idea['title'], self.idea['description'], script_prompt)
|
||||
else:
|
||||
script = await generate_script(self.idea['title'], self.idea['description'])
|
||||
with open(os.path.join( self.path, "script.json"), "w") as f:
|
||||
json.dump(json.loads(script), f)
|
||||
f.close()
|
||||
|
||||
Reference in New Issue
Block a user