Hello friends! Could you please help me deploy my artificial intelligence model on Glitch server? My model works perfectly on my computer when I run the local server using the command ‘python app.py’, but when I uploaded my model to Glitch hosting and installed all the necessary libraries, I faced an issue that Glitch does not support the POST method.
You can check it yourself, here is my AI model for predicting the cost of transporting cargo from point A to point B considering the weight of the cargo.
app.py
hidden
client.py
hidden
data.csv
cargo,cost,distance
100,200,10
200,400,20
300,600,30
400,800,40
500,1000,50
dataframe.py
import pandas as pd
Define the data as a dictionary
data = {
‘distance’: [10, 20, 30, 40, 50],
‘cargo’: [100, 200, 300, 400, 500],
‘cost’: [200, 400, 600, 800, 1000]
}
Create a pandas DataFrame from the dictionary
df = pd.DataFrame(data)
Save the DataFrame as a CSV file
df.to_csv(‘data.csv’, index=False)
my_model.py
hidden
predict.py
from app import get_distance
start = ‘10005’
end = ‘10006’
distance = get_distance(start, end)
print(“The distance between {} and {} is {} miles”.format(start, end, distance))
start.sh
python app.py
index.html
HTML here:
https:// chip-nine-wallflower.glitch . me/
(remove spaces)
I sat for 15 hours in a row in this project but did not figure it out. imma going to sleep. I am hope for your help!