Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -224,7 +224,6 @@ def get_task_instruction_for_user(context):
|
|
| 224 |
</span>
|
| 225 |
{ticker_name}
|
| 226 |
</div>
|
| 227 |
-
|
| 228 |
<!-- User Narrative (Bold label, Normal narrative) -->
|
| 229 |
<div style="text-align: left; font-size: 20px; font-weight: bold; margin-bottom: 20px;">
|
| 230 |
User Narrative
|
|
@@ -418,10 +417,7 @@ def create_demo():
|
|
| 418 |
personality=PERSONALITY_INT
|
| 419 |
)
|
| 420 |
message = "Pragmatist personality is successfully applied."
|
| 421 |
-
elif (
|
| 422 |
-
personality_choice
|
| 423 |
-
== "Misadvisor (Just for fun! Unreliable, Messy, Sarcastic - don't take it seriously!)"
|
| 424 |
-
):
|
| 425 |
new_sys_desc_no_ctx = SYSTEM_INSTRUCTION_PERSONALITY.format(personality=PERSONALITY_MISADVISOR)
|
| 426 |
new_sys_desc_user_elicitation = SYSTEM_INSTRUCTION_PREFERENCE_ELICITATION_PERSONALITY.format(
|
| 427 |
personality=PERSONALITY_MISADVISOR
|
|
@@ -612,7 +608,6 @@ def create_demo():
|
|
| 612 |
chat_history
|
| 613 |
retrieved_passage
|
| 614 |
rewritten_query
|
| 615 |
-
|
| 616 |
"""
|
| 617 |
assert (
|
| 618 |
tab_name is not None or user_elicitation is True
|
|
@@ -889,10 +884,9 @@ def create_demo():
|
|
| 889 |
|
| 890 |
def set_initial_values(request: gr.Request):
|
| 891 |
# Set user specific information (Session State)
|
| 892 |
-
|
| 893 |
user_id = "user_2_0_0"
|
| 894 |
user_in_narrative_id = "0"
|
| 895 |
-
narrative_id = "0"
|
| 896 |
experiment_id = "2"
|
| 897 |
system_description_without_context = get_inst_without_context(experiment_id)
|
| 898 |
system_description_user_elicitation = get_user_preference_elicitation(experiment_id)
|
|
@@ -1040,7 +1034,6 @@ def create_demo():
|
|
| 1040 |
value={
|
| 1041 |
"history": "",
|
| 1042 |
"summary_history": """User Profile collected in the previous conversations: Based on our previous conversation, here's a summary of your investment preferences:
|
| 1043 |
-
|
| 1044 |
# 1. **Preferred Industries:** You're interested in investing in the healthcare sector, without a specific preference for sub-industries such as pharmaceuticals, medical devices, biotechnology, or healthcare services.
|
| 1045 |
# 2. **Value vs. Growth Stocks:** You prefer growth stocks, which have the potential for high returns but may be riskier.
|
| 1046 |
# 3. **Dividend vs. Non-Dividend Stocks:** You're open to both dividend and non-dividend growth stocks, focusing on reinvesting profits for future growth.
|
|
@@ -1292,7 +1285,8 @@ if __name__ == "__main__":
|
|
| 1292 |
# Global variables
|
| 1293 |
terminator = ["<eos>", "<unk>", "<sep>", "<pad>", "<cls>", "<mask>"]
|
| 1294 |
demo = create_demo()
|
| 1295 |
-
|
| 1296 |
demo.launch(
|
| 1297 |
share=True,
|
|
|
|
| 1298 |
)
|
|
|
|
| 224 |
</span>
|
| 225 |
{ticker_name}
|
| 226 |
</div>
|
|
|
|
| 227 |
<!-- User Narrative (Bold label, Normal narrative) -->
|
| 228 |
<div style="text-align: left; font-size: 20px; font-weight: bold; margin-bottom: 20px;">
|
| 229 |
User Narrative
|
|
|
|
| 417 |
personality=PERSONALITY_INT
|
| 418 |
)
|
| 419 |
message = "Pragmatist personality is successfully applied."
|
| 420 |
+
elif personality_choice == "Misadvisor (Unreliable, Messy, Sarcastic)":
|
|
|
|
|
|
|
|
|
|
| 421 |
new_sys_desc_no_ctx = SYSTEM_INSTRUCTION_PERSONALITY.format(personality=PERSONALITY_MISADVISOR)
|
| 422 |
new_sys_desc_user_elicitation = SYSTEM_INSTRUCTION_PREFERENCE_ELICITATION_PERSONALITY.format(
|
| 423 |
personality=PERSONALITY_MISADVISOR
|
|
|
|
| 608 |
chat_history
|
| 609 |
retrieved_passage
|
| 610 |
rewritten_query
|
|
|
|
| 611 |
"""
|
| 612 |
assert (
|
| 613 |
tab_name is not None or user_elicitation is True
|
|
|
|
| 884 |
|
| 885 |
def set_initial_values(request: gr.Request):
|
| 886 |
# Set user specific information (Session State)
|
| 887 |
+
user_id, user_in_narrative_id, narrative_id, experiment_id = set_user_id(request)
|
| 888 |
user_id = "user_2_0_0"
|
| 889 |
user_in_narrative_id = "0"
|
|
|
|
| 890 |
experiment_id = "2"
|
| 891 |
system_description_without_context = get_inst_without_context(experiment_id)
|
| 892 |
system_description_user_elicitation = get_user_preference_elicitation(experiment_id)
|
|
|
|
| 1034 |
value={
|
| 1035 |
"history": "",
|
| 1036 |
"summary_history": """User Profile collected in the previous conversations: Based on our previous conversation, here's a summary of your investment preferences:
|
|
|
|
| 1037 |
# 1. **Preferred Industries:** You're interested in investing in the healthcare sector, without a specific preference for sub-industries such as pharmaceuticals, medical devices, biotechnology, or healthcare services.
|
| 1038 |
# 2. **Value vs. Growth Stocks:** You prefer growth stocks, which have the potential for high returns but may be riskier.
|
| 1039 |
# 3. **Dividend vs. Non-Dividend Stocks:** You're open to both dividend and non-dividend growth stocks, focusing on reinvesting profits for future growth.
|
|
|
|
| 1285 |
# Global variables
|
| 1286 |
terminator = ["<eos>", "<unk>", "<sep>", "<pad>", "<cls>", "<mask>"]
|
| 1287 |
demo = create_demo()
|
| 1288 |
+
user_list, demo_list = load_username_and_pwd()
|
| 1289 |
demo.launch(
|
| 1290 |
share=True,
|
| 1291 |
+
# auth=user_list + demo_list + ["test", "test"],
|
| 1292 |
)
|