MartinKosela commited on
Commit
0f7e00d
·
1 Parent(s): f82a46a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -0
app.py CHANGED
@@ -86,3 +86,37 @@ if st.button("Recommend AI Model"):
86
  st.success("Thank you for your feedback!")
87
  else:
88
  st.warning("Please provide a description.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  st.success("Thank you for your feedback!")
87
  else:
88
  st.warning("Please provide a description.")
89
+
90
+ # Streamlit UI
91
+ st.title('AI Model Recommender')
92
+
93
+ description = st.text_area("Describe your application:", "")
94
+
95
+ if "rec_model_pressed" not in st.session_state:
96
+ st.session_state.rec_model_pressed = False
97
+
98
+ if "feedback_submitted" not in st.session_state:
99
+ st.session_state.feedback_submitted = False
100
+
101
+ if st.button("Recommend AI Model"):
102
+ st.session_state.rec_model_pressed = True
103
+
104
+ if st.session_state.rec_model_pressed:
105
+ if description:
106
+ recommended_model = recommend_ai_model_via_gpt(description)
107
+
108
+ st.subheader(f"Recommended AI Model: {recommended_model}")
109
+ explanation = explain_recommendation(recommended_model)
110
+ st.write("Reason:", explanation)
111
+
112
+ # Collecting rating and feedback through Streamlit
113
+ rating = st.slider("Rate the explanation from 1 (worst) to 5 (best):", 1, 5)
114
+ feedback = st.text_input("Any additional feedback?")
115
+
116
+ if st.button("Submit Feedback"):
117
+ st.session_state.feedback_submitted = True
118
+
119
+ if st.session_state.feedback_submitted:
120
+ st.success("Thank you for your feedback!")
121
+ else:
122
+ st.warning("Please provide a description.")