Update app.py
Browse files73 unmodified lines7475767778798081828384858673 unmodified linesresult = dynamic_huff_model(df_distances, df_attractiveness, alpha, beta, df_capacity, df_population, iterations, crowding_threshold)# Convert the result DataFrame to a CSV string for Gradio outputreturn result.to_csv(index=False)# Define the Gradio interface with a single JSON inputiface = gr.Interface(fn=app_function,inputs=gr.inputs.Textbox(label="Input JSON", lines=20, placeholder="Enter JSON with all parameters here..."),outputs="file",title="Dynamic Huff Model")73 unmodified lines747576777879808182838485868773 unmodified linesresult = dynamic_huff_model(df_distances, df_attractiveness, alpha, beta, df_capacity, df_population, iterations, crowding_threshold)# Convert the result DataFrame to a CSV string for Gradio outputresult_json = result.to_json(orient='split')return json.loads(result_json)# Define the Gradio interface with a single JSON inputiface = gr.Interface(fn=app_function,inputs=gr.Textbox(label="Input JSON", lines=20, placeholder="Enter JSON with all parameters here..."),outputs=gr.JSON(label="Output JSON"),title="Dynamic Huff Model")
app.py+4-3