MartinKosela commited on
Commit
c6cb6df
·
1 Parent(s): 58daaac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -6
app.py CHANGED
@@ -66,6 +66,7 @@ def explain_recommendation(model_name):
66
  st.title('AI Model Recommender')
67
 
68
  description = st.text_area("Describe your application:", "")
 
69
 
70
  if "rec_model_pressed" not in st.session_state:
71
  st.session_state.rec_model_pressed = False
@@ -78,17 +79,23 @@ if st.button("Recommend AI Model"):
78
 
79
  if st.session_state.rec_model_pressed:
80
  if description:
81
- recommended_model = recommend_ai_model_via_gpt(description)
82
-
 
 
 
 
 
 
83
  # Validate recommended model
84
  # Commenting out model validation for the example
85
  # if recommended_model not in KNOWN_MODELS:
86
  # st.warning("The recommendation is ambiguous. Please refine your description or consult an expert.")
87
  # else:
88
- st.subheader(f"Recommended AI Model: {recommended_model}")
89
  explanation = explain_recommendation(recommended_model)
90
  st.write("Reason:", explanation)
91
-
92
  # Collecting rating and feedback through Streamlit
93
  rating = st.slider("Rate the explanation from 1 (worst) to 5 (best):", 1, 5)
94
  feedback = st.text_input("Any additional feedback?")
@@ -98,6 +105,8 @@ if st.session_state.rec_model_pressed:
98
 
99
  if st.session_state.feedback_submitted:
100
  st.success("Thank you for your feedback!")
101
- st.success("Contact team@autumn8.ai or call (857) 600-0180 to learn how we can fine-tune and host this app for you.")
 
 
102
  else:
103
- st.warning("Please provide a description.")
 
66
  st.title('AI Model Recommender')
67
 
68
  description = st.text_area("Describe your application:", "")
69
+ recommendation_type = st.radio("What type of recommendation are you looking for?", ["Recommend Open-Source Model", "Recommend API Service"])
70
 
71
  if "rec_model_pressed" not in st.session_state:
72
  st.session_state.rec_model_pressed = False
 
79
 
80
  if st.session_state.rec_model_pressed:
81
  if description:
82
+ # Modified query based on recommendation type
83
+ if recommendation_type == "Recommend Open-Source Model":
84
+ query = f"Given the application described as: '{description}', which open-source AI model would be most suitable?"
85
+ else: # Recommend API Service
86
+ query = f"Given the application described as: '{description}', which AI service API would be best?"
87
+
88
+ recommended_model = recommend_ai_model_via_gpt(query) # Updated function call
89
+
90
  # Validate recommended model
91
  # Commenting out model validation for the example
92
  # if recommended_model not in KNOWN_MODELS:
93
  # st.warning("The recommendation is ambiguous. Please refine your description or consult an expert.")
94
  # else:
95
+ st.subheader(f"Recommended: {recommended_model}")
96
  explanation = explain_recommendation(recommended_model)
97
  st.write("Reason:", explanation)
98
+
99
  # Collecting rating and feedback through Streamlit
100
  rating = st.slider("Rate the explanation from 1 (worst) to 5 (best):", 1, 5)
101
  feedback = st.text_input("Any additional feedback?")
 
105
 
106
  if st.session_state.feedback_submitted:
107
  st.success("Thank you for your feedback!")
108
+
109
+ st.write("Contact team@autumn8.ai or call (857) 600-0180 to learn how we can fine-tune and host this app for you.")
110
+
111
  else:
112
+ st.warning("Please provide a description.")