Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
from ontochat.functions import set_openai_api_key, user_story_generator, cq_generator, load_example_user_story, clustering_generator, ontology_testing,
|
3 |
-
|
4 |
-
# Global variables to hold pre-identified prompts
|
5 |
-
preidentified_prompts = get_preidentified_prompts()
|
6 |
|
7 |
user_story_template = """**Persona:**\n\n- Name: -\n- Age: -\n- Occupation: -\n- Skills: -\n- Interests: -\n\n**Goal:**\n\n- Description: -\n- Keywords: -\n\n**Scenario:**\n\n- Before: -\n- During: -\n- After: -\n\n**Example Data:**\n\n- Category: -\n- Data: -\n\n**Resources:**\n\n- Resource Name: -\n- Link: -"""
|
8 |
|
@@ -57,10 +54,14 @@ with gr.Blocks() as user_story_interface:
|
|
57 |
label="Suggestion",
|
58 |
type="index",
|
59 |
samples=[
|
60 |
-
["
|
61 |
-
["
|
62 |
-
["
|
63 |
-
["
|
|
|
|
|
|
|
|
|
64 |
],
|
65 |
samples_per_page = 10
|
66 |
)
|
@@ -68,11 +69,7 @@ with gr.Blocks() as user_story_interface:
|
|
68 |
user_story_input.submit(
|
69 |
fn=user_story_generator,
|
70 |
inputs=[user_story_input, user_story_chatbot],
|
71 |
-
outputs=[user_story_chatbot, user_story_input
|
72 |
-
).then(
|
73 |
-
fn=update_examples,
|
74 |
-
inputs=None,
|
75 |
-
outputs=[elicitation_questions_dataset]
|
76 |
)
|
77 |
elicitation_questions_dataset.click(
|
78 |
fn=load_example,
|
|
|
1 |
import gradio as gr
|
2 |
+
from ontochat.functions import set_openai_api_key, user_story_generator, cq_generator, load_example_user_story, clustering_generator, ontology_testing, load_example
|
|
|
|
|
|
|
3 |
|
4 |
user_story_template = """**Persona:**\n\n- Name: -\n- Age: -\n- Occupation: -\n- Skills: -\n- Interests: -\n\n**Goal:**\n\n- Description: -\n- Keywords: -\n\n**Scenario:**\n\n- Before: -\n- During: -\n- After: -\n\n**Example Data:**\n\n- Category: -\n- Data: -\n\n**Resources:**\n\n- Resource Name: -\n- Link: -"""
|
5 |
|
|
|
54 |
label="Suggestion",
|
55 |
type="index",
|
56 |
samples=[
|
57 |
+
["Refine Persona"],
|
58 |
+
["Refine User Goal"],
|
59 |
+
["Refine Actions"],
|
60 |
+
["Refine Keywords"],
|
61 |
+
["Refine Current Methods"],
|
62 |
+
["Refine Challenges"],
|
63 |
+
["Refine New Methods"],
|
64 |
+
["Refine Outcomes"]
|
65 |
],
|
66 |
samples_per_page = 10
|
67 |
)
|
|
|
69 |
user_story_input.submit(
|
70 |
fn=user_story_generator,
|
71 |
inputs=[user_story_input, user_story_chatbot],
|
72 |
+
outputs=[user_story_chatbot, user_story_input]
|
|
|
|
|
|
|
|
|
73 |
)
|
74 |
elicitation_questions_dataset.click(
|
75 |
fn=load_example,
|