Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,7 +25,7 @@ def generate_image(text):
|
|
| 25 |
logging.debug("Generating image with prompt: %s", text)
|
| 26 |
response = openai.images.generate(
|
| 27 |
model="dall-e-3",
|
| 28 |
-
prompt="Create
|
| 29 |
n=1,
|
| 30 |
size="1024x1024"
|
| 31 |
)
|
|
@@ -70,7 +70,7 @@ if torch.cuda.is_available():
|
|
| 70 |
|
| 71 |
|
| 72 |
def make_prompt(entry):
|
| 73 |
-
return f"### Human: When asked to explain use a story.Don't repeat the assesments, limit to
|
| 74 |
|
| 75 |
def process_text(text):
|
| 76 |
|
|
@@ -151,7 +151,6 @@ def generate(
|
|
| 151 |
|
| 152 |
|
| 153 |
def remove_last_sentence(text):
|
| 154 |
-
# Assuming sentences end with a period followed by space or end of string
|
| 155 |
sentences = re.split(r'(?<=\.)\s', text)
|
| 156 |
return ' '.join(sentences[:-1]) if sentences else text
|
| 157 |
|
|
|
|
| 25 |
logging.debug("Generating image with prompt: %s", text)
|
| 26 |
response = openai.images.generate(
|
| 27 |
model="dall-e-3",
|
| 28 |
+
prompt="Create a 4 panel pixar style illustration that accurately depicts the character and the setting of a story:" + text,
|
| 29 |
n=1,
|
| 30 |
size="1024x1024"
|
| 31 |
)
|
|
|
|
| 70 |
|
| 71 |
|
| 72 |
def make_prompt(entry):
|
| 73 |
+
return f"### Human: When asked to explain use a story.Don't repeat the assesments, limit to 500 words.However keep context in mind if edits to the content is required. {entry} ### Assistant:"
|
| 74 |
|
| 75 |
def process_text(text):
|
| 76 |
|
|
|
|
| 151 |
|
| 152 |
|
| 153 |
def remove_last_sentence(text):
|
|
|
|
| 154 |
sentences = re.split(r'(?<=\.)\s', text)
|
| 155 |
return ' '.join(sentences[:-1]) if sentences else text
|
| 156 |
|