Spaces:
Sleeping
Sleeping
refactors and definitions
Browse files- README.md +10 -10
- helpers/__init__.py +4 -0
- homeros.py +10 -2
- main.py +7 -6
README.md
CHANGED
@@ -34,7 +34,7 @@ It puts the user in charge of a how the story is going to develop.
|
|
34 |
## Story schema
|
35 |
|
36 |
- STRING `uuid` = uuid of this story
|
37 |
-
- STRING `status` = 'not_started' / 'ongoing' / 'finished'
|
38 |
- TEXT `world` = text description of the world
|
39 |
- TEXT `hero` = text description of the hero of the story
|
40 |
- TEXT `plot` = high level description of the plot. without chapters or anything like that. we can use this to later break down into chapters and get smarter about story ark management with a second LLM
|
@@ -67,15 +67,15 @@ It puts the user in charge of a how the story is going to develop.
|
|
67 |
|
68 |
## Basic ToDo
|
69 |
|
70 |
-
- Gradio input/outpus/state setup (with text only)
|
71 |
-
- Story object setup, schema, logic
|
72 |
-
- GPT-4 story generation in a gradio interface
|
73 |
-
-
|
74 |
-
-
|
75 |
-
-
|
76 |
|
77 |
## Enhancements
|
78 |
|
79 |
-
- Add SQlite DB and save stories
|
80 |
-
- Add option to download the full story as one .mp3
|
81 |
-
- Add meta-moderator role to manage story
|
|
|
34 |
## Story schema
|
35 |
|
36 |
- STRING `uuid` = uuid of this story
|
37 |
+
- STRING `status` = 'not_started' / 'generating_metadata' / ongoing' / 'finished'
|
38 |
- TEXT `world` = text description of the world
|
39 |
- TEXT `hero` = text description of the hero of the story
|
40 |
- TEXT `plot` = high level description of the plot. without chapters or anything like that. we can use this to later break down into chapters and get smarter about story ark management with a second LLM
|
|
|
67 |
|
68 |
## Basic ToDo
|
69 |
|
70 |
+
- [x] Gradio input/outpus/state setup (with text only)
|
71 |
+
- [x] Story object setup, schema, logic
|
72 |
+
- [ ] GPT-4 story generation in a gradio interface
|
73 |
+
- [ ] Interchange text input for whisper
|
74 |
+
- [ ] Inerchange text output for play.ht voice generation
|
75 |
+
- [ ] Dockerfile and deploy (including magic word for access control)
|
76 |
|
77 |
## Enhancements
|
78 |
|
79 |
+
- [ ] Add SQlite DB and save stories
|
80 |
+
- [ ] Add option to download the full story as one .mp3
|
81 |
+
- [ ] Add meta-moderator role to manage story ark better
|
helpers/__init__.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import uuid
|
2 |
+
|
3 |
+
def gen_unique_id():
|
4 |
+
return str(uuid.uuid4())
|
homeros.py
CHANGED
@@ -1,3 +1,11 @@
|
|
|
|
|
|
1 |
|
2 |
-
def
|
3 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
def start_story(story):
|
2 |
+
return story
|
3 |
|
4 |
+
def define_metadata(user_input, field, story):
|
5 |
+
return story
|
6 |
+
|
7 |
+
def continue_story(user_input, story):
|
8 |
+
return story
|
9 |
+
|
10 |
+
def finish_story(user_input, story):
|
11 |
+
return story
|
main.py
CHANGED
@@ -1,22 +1,23 @@
|
|
1 |
import gradio as gr
|
2 |
from pprint import pprint
|
3 |
-
import uuid
|
4 |
import json
|
5 |
from loguru import logger
|
6 |
from dotenv import load_dotenv
|
|
|
7 |
load_dotenv()
|
8 |
|
9 |
-
from homeros import start_story, continue_story
|
10 |
-
|
11 |
-
def gen_unique_id():
|
12 |
-
return str(uuid.uuid4())
|
13 |
|
14 |
def do_homeros(user_input, story):
|
15 |
|
16 |
pprint(story)
|
17 |
|
18 |
if story["status"] == "not_started":
|
19 |
-
story["uuid"] = gen_unique_id()
|
|
|
|
|
|
|
|
|
20 |
|
21 |
return json.dumps(story["messages"]), story
|
22 |
|
|
|
1 |
import gradio as gr
|
2 |
from pprint import pprint
|
|
|
3 |
import json
|
4 |
from loguru import logger
|
5 |
from dotenv import load_dotenv
|
6 |
+
import helpers
|
7 |
load_dotenv()
|
8 |
|
9 |
+
from homeros import start_story, continue_story, finish_story, define_metadata
|
|
|
|
|
|
|
10 |
|
11 |
def do_homeros(user_input, story):
|
12 |
|
13 |
pprint(story)
|
14 |
|
15 |
if story["status"] == "not_started":
|
16 |
+
story["uuid"] = helpers.gen_unique_id()
|
17 |
+
story["status"] = "generating_metadata"
|
18 |
+
|
19 |
+
else:
|
20 |
+
story["messages"].append("blah lbah n")
|
21 |
|
22 |
return json.dumps(story["messages"]), story
|
23 |
|