Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ SYSTEM_PROMPT = (
|
|
| 13 |
)
|
| 14 |
|
| 15 |
# -----------------------------
|
| 16 |
-
# Chat logic (
|
| 17 |
# -----------------------------
|
| 18 |
def chat(user_input, history):
|
| 19 |
if history is None:
|
|
@@ -36,7 +36,7 @@ def chat(user_input, history):
|
|
| 36 |
reply = completion.choices[0].message.content
|
| 37 |
history.append((user_input, reply))
|
| 38 |
|
| 39 |
-
return history
|
| 40 |
|
| 41 |
|
| 42 |
# -----------------------------
|
|
@@ -59,18 +59,12 @@ def generate_storyboard(scenario):
|
|
| 59 |
|
| 60 |
|
| 61 |
# -----------------------------
|
| 62 |
-
# UI (
|
| 63 |
# -----------------------------
|
| 64 |
chat_ui = gr.Interface(
|
| 65 |
fn=chat,
|
| 66 |
-
inputs=
|
| 67 |
-
|
| 68 |
-
gr.State([])
|
| 69 |
-
],
|
| 70 |
-
outputs=[
|
| 71 |
-
gr.Chatbot(label="Storyboard Chat"),
|
| 72 |
-
gr.State([])
|
| 73 |
-
],
|
| 74 |
title="📖 Storyboard Assistant",
|
| 75 |
)
|
| 76 |
|
|
|
|
| 13 |
)
|
| 14 |
|
| 15 |
# -----------------------------
|
| 16 |
+
# Chat logic (Interface-safe)
|
| 17 |
# -----------------------------
|
| 18 |
def chat(user_input, history):
|
| 19 |
if history is None:
|
|
|
|
| 36 |
reply = completion.choices[0].message.content
|
| 37 |
history.append((user_input, reply))
|
| 38 |
|
| 39 |
+
return history
|
| 40 |
|
| 41 |
|
| 42 |
# -----------------------------
|
|
|
|
| 59 |
|
| 60 |
|
| 61 |
# -----------------------------
|
| 62 |
+
# UI (Interface ONLY)
|
| 63 |
# -----------------------------
|
| 64 |
chat_ui = gr.Interface(
|
| 65 |
fn=chat,
|
| 66 |
+
inputs=gr.Textbox(label="Your Message"),
|
| 67 |
+
outputs=gr.Chatbot(label="Storyboard Chat"),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
title="📖 Storyboard Assistant",
|
| 69 |
)
|
| 70 |
|