Skip to content

Commit

Permalink
modified curl call
Browse files Browse the repository at this point in the history
  • Loading branch information
mionaD-upc committed Dec 4, 2023
1 parent 7b012f6 commit 75852f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/web/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def upload_file():
file.save(file_path)

#print("The received argument variable is: ", adress)
command = f"curl -X POST -H 'Content-Type: multipart/form-data' -H 'Accept: application/json' -F 'beans_img=@{file_path}' http://{adress}:4000/make_prediction"
# MD change : (Pau instructions added)
command = 'curl -X POST -H "Content-Type: multipart/form-data" -H "Accept: application/json" -F "beans_img=@{}" http://{}:443/make_prediction'.format(file_path.replace("\\", "\\\\"), adress)
app.logger.info(command)
# Get the classification result
response = subprocess.getoutput(command)

Expand Down
3 changes: 2 additions & 1 deletion src/web/starter.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def save_public_ip(public_ip):

def run_app(public_ip):
# Run app.py passing the public IP as an argument
subprocess.run(["python", "app.py", public_ip])
# MD change: to python3
subprocess.run(["python3", "app.py", public_ip])

def main():
docker_status = get_docker_status()
Expand Down

0 comments on commit 75852f4

Please sign in to comment.