Spaces:
Runtime error
Runtime error
add basic logic
Browse files
app.py
CHANGED
@@ -58,6 +58,12 @@ def is_valid_task_for_model(model_name, task_type):
|
|
58 |
|
59 |
possible_tags = HUB_TAGS[TASK_TYPES[task_type]]
|
60 |
return any(tag in model_tags for tag in possible_tags)
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
# =====================================================================================================================
|
62 |
|
63 |
|
@@ -97,16 +103,13 @@ with demo:
|
|
97 |
choices=list(PROBLEMS.keys()),
|
98 |
interactive=True,
|
99 |
)
|
100 |
-
|
101 |
with gr.Column(scale=2):
|
102 |
-
|
|
|
|
|
|
|
103 |
|
104 |
-
gr.Markdown(
|
105 |
-
"""
|
106 |
-
Is your problem not on the list? Need more suggestions? Have you spotted an error? Please open a
|
107 |
-
[new discussion](https://huggingface.co/spaces/joaogante/generate_quality_improvement/discussions) 🙏
|
108 |
-
"""
|
109 |
-
)
|
110 |
# =====================================================================================================================
|
111 |
|
112 |
if __name__ == "__main__":
|
|
|
58 |
|
59 |
possible_tags = HUB_TAGS[TASK_TYPES[task_type]]
|
60 |
return any(tag in model_tags for tag in possible_tags)
|
61 |
+
|
62 |
+
|
63 |
+
def get_suggestions(task_type, model_name, problem_type):
|
64 |
+
if task_type == "" or problem_type == "":
|
65 |
+
return "👈 Please select a task type and a problem type."
|
66 |
+
return ""
|
67 |
# =====================================================================================================================
|
68 |
|
69 |
|
|
|
103 |
choices=list(PROBLEMS.keys()),
|
104 |
interactive=True,
|
105 |
)
|
106 |
+
button = gr.Button(value="Get Suggestions!")
|
107 |
with gr.Column(scale=2):
|
108 |
+
suggestions = gr.Markdown(value="")
|
109 |
+
|
110 |
+
button.click(get_suggestions, inputs=[task_type, model_name, problem_type], outputs=suggestions)
|
111 |
+
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
# =====================================================================================================================
|
114 |
|
115 |
if __name__ == "__main__":
|