killswitch009 commited on
Commit
2b1267f
·
verified ·
1 Parent(s): 407ffa5

Update streamlit_app.py

Browse files
Files changed (1) hide show
  1. streamlit_app.py +29 -29
streamlit_app.py CHANGED
@@ -1,30 +1,30 @@
1
- import streamlit as st
2
- import requests
3
-
4
- st.title("Lead Conversion Prediction")
5
-
6
- st.write("Enter lead details:")
7
-
8
- age = st.number_input("Age", min_value=18, max_value=100, value=25)
9
- website_visits = st.number_input("Website Visits", min_value=0, value=3)
10
- time_spent = st.number_input("Time Spent on Website (seconds)", min_value=0, value=200)
11
-
12
- if st.button("Predict"):
13
-
14
- url = "https://killswitch009-lead-conversion-api.hf.space/predict"
15
-
16
- data = {
17
- "data": [age, website_visits, time_spent]
18
- }
19
-
20
- response = requests.post(url, json=data)
21
-
22
- if response.status_code == 200:
23
- result = response.json()["prediction"]
24
-
25
- if result == 1:
26
- st.success("This lead is likely to convert ✅")
27
- else:
28
- st.error("This lead is unlikely to convert ❌")
29
- else:
30
  st.error("Error connecting to API")
 
1
+ import streamlit as st
2
+ import requests
3
+
4
+ st.title("Lead Conversion Prediction")
5
+
6
+ st.write("Enter lead details:")
7
+
8
+ age = st.number_input("Age", min_value=18, max_value=100, value=25)
9
+ website_visits = st.number_input("Website Visits", min_value=0, value=3)
10
+ time_spent = st.number_input("Time Spent on Website (seconds)", min_value=0, value=200)
11
+
12
+ if st.button("Predict"):
13
+
14
+ url = "https://killswitch009-lead-conversion-api.hf.space/predict"
15
+
16
+ data = {
17
+ "data": [age, website_visits, time_spent]
18
+ }
19
+
20
+ response = requests.post(url, json=data)
21
+
22
+ if response.status_code == 200:
23
+ result = response.json()["prediction"]
24
+
25
+ if result == 1:
26
+ st.success("This lead is likely to convert ✅")
27
+ else:
28
+ st.error("This lead is unlikely to convert ❌")
29
+ else:
30
  st.error("Error connecting to API")