pragmat commited on
Commit
450d3de
·
verified ·
1 Parent(s): cb25a50

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -39,7 +39,7 @@ input_data = pd.DataFrame([{'Product_Id': Product_Id,
39
 
40
  # Make prediction when the "Predict" button is clicked
41
  if st.button("Predict"):
42
- response = requests.post("https://<username>-<repo_id>.hf.space/v1/revenue", json=input_data.to_dict(orient='records')[0]) # Send data to Flask API
43
  if response.status_code == 200:
44
  prediction = response.json()['Predicted Sales Revenue (in dollars)']
45
  st.success(f"Predicted Sales Revenue (in dollars): {prediction}")
@@ -55,7 +55,7 @@ uploaded_file = st.file_uploader("Upload CSV file for batch prediction", type=["
55
  # Make batch prediction when the "Predict Batch" button is clicked
56
  if uploaded_file is not None:
57
  if st.button("Predict Batch"):
58
- response = requests.post("https://<username>-<repo_id>.hf.space/v1/revenuebatch", files={"file": uploaded_file}) # Send file to Flask API
59
  if response.status_code == 200:
60
  predictions = response.json()
61
  st.success("Batch predictions completed!")
 
39
 
40
  # Make prediction when the "Predict" button is clicked
41
  if st.button("Predict"):
42
+ response = requests.post("https://pragmat-SalesRevenuePredictionBackend.hf.space/v1/revenue", json=input_data.to_dict(orient='records')[0]) # Send data to Flask API
43
  if response.status_code == 200:
44
  prediction = response.json()['Predicted Sales Revenue (in dollars)']
45
  st.success(f"Predicted Sales Revenue (in dollars): {prediction}")
 
55
  # Make batch prediction when the "Predict Batch" button is clicked
56
  if uploaded_file is not None:
57
  if st.button("Predict Batch"):
58
+ response = requests.post("https://pragmat-SalesRevenuePredictionBackend.hf.space/v1/revenuebatch", files={"file": uploaded_file}) # Send file to Flask API
59
  if response.status_code == 200:
60
  predictions = response.json()
61
  st.success("Batch predictions completed!")