Spaces:
Sleeping
Sleeping
Merge pull request #4 from ZnS77/bugfix/restore-task-description
Browse filesFiles changed (2)
- app.py+6-8
- instructions.py+39-40
177 unmodified lines17817918018118218318418518618718818919019119219319413 unmodified lines20820921021121221321410 unmodified lines22522622722822923023144 unmodified lines27627727827928028128251 unmodified lines334335336337338339340177 unmodified lineslogin_status = gr.Textbox(label="Next Tasks", interactive=False)group = gr.State()with gr.Column(visible=False) as textbox_task:description = gr.Textbox(label="Task Description",value = human_task_description(),interactive=False,lines=12)with gr.Accordion(label = "Click to See 17 SDGs",open=False):gr.Markdown(SDG_DETAILS)ai_task_description = ai_task_description()# initialization of different group contentsgroup_a_content = gr.Group(visible=False, elem_id="group-a")13 unmodified lineselse:return gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), invalid_group()login_button.click(login, inputs=identification_code, outputs=[textbox_task, group_a_content, group_b_content, group_c_content, login_status])10 unmodified linessubmit_btn.click(fn=lambda task, human_input, id: handle_create_sequential(task, human_input, session_manager, api_key, id),inputs=[ai_task_description, human_input, identification_code],outputs=[ai_output, session_index])44 unmodified linescreate_initial_btn.click(fn=lambda task, id: handle_create_reverse_sequential(task, session_manager, api_key, id),inputs=[ai_task_description, identification_code],outputs=[initial_answer, session_index])51 unmodified linescreate_btn.click(fn=lambda task, human_input, id: handle_create_parallel(task, human_input, session_manager, api_key, id),inputs=[ai_task_description, human_input, identification_code],outputs=[ai_initial_output, session_index])177 unmodified lines17817918018118218318418518618718818919019119213 unmodified lines20620720820921021121210 unmodified lines22322422522622722822944 unmodified lines27427527627727827928051 unmodified lines332333334335336337338177 unmodified lineslogin_status = gr.Textbox(label="Next Tasks", interactive=False)group = gr.State()with gr.Column(visible=False) as task:description = gr.Textbox(label="Task Description",value = default_task_description(),interactive=False,lines=12)with gr.Accordion(label = "Click to See 17 SDGs",open=False):gr.Markdown(SDG_DETAILS)# initialization of different group contentsgroup_a_content = gr.Group(visible=False, elem_id="group-a")13 unmodified lineselse:return gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), invalid_group()login_button.click(login, inputs=identification_code, outputs=[task, group_a_content, group_b_content, group_c_content, login_status])10 unmodified linessubmit_btn.click(fn=lambda task, human_input, id: handle_create_sequential(task, human_input, session_manager, api_key, id),inputs=[description, human_input, identification_code],outputs=[ai_output, session_index])44 unmodified linescreate_initial_btn.click(fn=lambda task, id: handle_create_reverse_sequential(task, session_manager, api_key, id),inputs=[description, identification_code],outputs=[initial_answer, session_index])51 unmodified linescreate_btn.click(fn=lambda task, human_input, id: handle_create_parallel(task, human_input, session_manager, api_key, id),inputs=[description, human_input, identification_code],outputs=[ai_initial_output, session_index])
56 unmodified lines5758596061626364656667686 unmodified lines7576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711856 unmodified linesreturn NOTESdef human_task_description():# display the task description on the interface to human# TODO: Decorate the text to make it more readableHUMAN_TASK_DESCRIPTION = """Given Airbnb's current business model below, please propose three ideas to make it comply with the 17 SDGs.The final answer should be at least 100 words.Airbnb caters to two main groups:1. Travelers: People looking for unique and affordable places to stay, including tourists, business travelers, and families who prefer a home-like experience over hotels.6 unmodified lines- Safety and Support: Ensures safety with verification processes and offers reliable customer support.- Technology and Marketing: Invests in technology to improve user experience and efficiency, and uses marketing to attract and retain users."""return HUMAN_TASK_DESCRIPTIONdef ai_task_description():# task description passed to AI in the promptAI_TASK_DESCRIPTION = """Given Airbnb's current business model below, please propose **three** ideas to make it comply with the 17 SDGs. Your output should be around **100** words in total.The final answer will be evaluated on Novelty (the uniqueness and originality of the ideas), Feasibility (the practicality and implementability of suggested actions), Inimitability (how difficult for competitors to replicate), and Goal Alignment (how aligned the ideas are with Airbnb’s business objectives and 17 SDGs).Airbnb caters to two main groups:1. Travelers: People looking for unique and affordable places to stay, including tourists, business travelers, and families who prefer a home-like experience over hotels.2. Property Owners: Individuals who rent out their spaces, from single rooms to entire homes, to earn extra income.Value for Guests and Hosts- For Guests: Airbnb offers a variety of unique places to stay, providing a local and authentic experience with secure booking.- For Hosts: Airbnb helps property owners make money by renting out their spaces and provides tools to list, price, and market their properties.How Airbnb Operates- User-Friendly Platform: Connects hosts with guests through an easy-to-use online marketplace.- Safety and Support: Ensures safety with verification processes and offers reliable customer support.- Technology and Marketing: Invests in technology to improve user experience and efficiency, and uses marketing to attract and retain users.17 Sustainable Development Goals (SDGs):1. No Poverty: Eradicate all forms of poverty.2. Zero Hunger: End hunger and promote sustainable agriculture.3. Good Health and Well-being: Ensure health and well-being for everyone.4. Quality Education: Guarantee inclusive, quality education for all.5. Gender Equality: Empower women and achieve gender equality.6. Clean Water and Sanitation: Provide sustainable water and sanitation.7. Affordable and Clean Energy: Ensure access to sustainable energy.8. Decent Work and Economic Growth: Foster inclusive economic growth and decent jobs.9. Industry, Innovation and Infrastructure: Build resilient infrastructure and promote innovation.10. Reduced Inequality: Decrease inequality within and among countries.11. Sustainable Cities and Communities: Develop safe and sustainable communities.12. Responsible Consumption and Production: Ensure sustainable consumption and production.13. Climate Action: Take action against climate change.14. Life Below Water: Protect oceans and marine life.15. Life on Land: Sustainably manage ecosystems and biodiversity.16. Peace and Justice Strong Institutions: Promote peace, justice, and strong institutions.17. Partnerships to achieve the Goals: Enhance global partnerships for sustainable development."""return AI_TASK_DESCRIPTION56 unmodified lines57585960616263646566676 unmodified lines747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611756 unmodified linesreturn NOTESdef default_task_description():# display the task description on the interface to human# TODO: Decorate the text to make it more readableTASK_DESCRIPTION = """Given Airbnb's current business model below, please propose three ideas to make it comply with the 17 Sustainable Development Goals (SDGs). Your answer should be around 100 words.Airbnb caters to two main groups:1. Travelers: People looking for unique and affordable places to stay, including tourists, business travelers, and families who prefer a home-like experience over hotels.6 unmodified lines- Safety and Support: Ensures safety with verification processes and offers reliable customer support.- Technology and Marketing: Invests in technology to improve user experience and efficiency, and uses marketing to attract and retain users."""return TASK_DESCRIPTION# def ai_task_description():# # task description passed to AI in the prompt# AI_TASK_DESCRIPTION = """# Given Airbnb's current business model below, please propose **three** ideas to make it comply with the 17 SDGs. Your output should be around **100** words in total.# The final answer will be evaluated on Novelty (the uniqueness and originality of the ideas), Feasibility (the practicality and implementability of suggested actions), Inimitability (how difficult for competitors to replicate), and Goal Alignment (how aligned the ideas are with Airbnb’s business objectives and 17 SDGs).# Airbnb caters to two main groups:# 1. Travelers: People looking for unique and affordable places to stay, including tourists, business travelers, and families who prefer a home-like experience over hotels.# 2. Property Owners: Individuals who rent out their spaces, from single rooms to entire homes, to earn extra income.# Value for Guests and Hosts# - For Guests: Airbnb offers a variety of unique places to stay, providing a local and authentic experience with secure booking.# - For Hosts: Airbnb helps property owners make money by renting out their spaces and provides tools to list, price, and market their properties.# How Airbnb Operates# - User-Friendly Platform: Connects hosts with guests through an easy-to-use online marketplace.# - Safety and Support: Ensures safety with verification processes and offers reliable customer support.# - Technology and Marketing: Invests in technology to improve user experience and efficiency, and uses marketing to attract and retain users.# 17 Sustainable Development Goals (SDGs):# 1. No Poverty: Eradicate all forms of poverty.# 2. Zero Hunger: End hunger and promote sustainable agriculture.# 3. Good Health and Well-being: Ensure health and well-being for everyone.# 4. Quality Education: Guarantee inclusive, quality education for all.# 5. Gender Equality: Empower women and achieve gender equality.# 6. Clean Water and Sanitation: Provide sustainable water and sanitation.# 7. Affordable and Clean Energy: Ensure access to sustainable energy.# 8. Decent Work and Economic Growth: Foster inclusive economic growth and decent jobs.# 9. Industry, Innovation and Infrastructure: Build resilient infrastructure and promote innovation.# 10. Reduced Inequality: Decrease inequality within and among countries.# 11. Sustainable Cities and Communities: Develop safe and sustainable communities.# 12. Responsible Consumption and Production: Ensure sustainable consumption and production.# 13. Climate Action: Take action against climate change.# 14. Life Below Water: Protect oceans and marine life.# 15. Life on Land: Sustainably manage ecosystems and biodiversity.# 16. Peace and Justice Strong Institutions: Promote peace, justice, and strong institutions.# 17. Partnerships to achieve the Goals: Enhance global partnerships for sustainable development.# """# return AI_TASK_DESCRIPTION
app.py+6-8
instructions.py+39-40