From 68c671f97354f11fa56fba139462a1ba16966908 Mon Sep 17 00:00:00 2001 From: rahult Date: Wed, 10 Jul 2019 17:43:01 +0530 Subject: [PATCH] this is a test --- example/main.py | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ example/req | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+), 0 deletions(-) create mode 100644 example/main.py create mode 100644 example/req diff --git a/example/main.py b/example/main.py new file mode 100644 index 0000000..1e62e8f --- /dev/null +++ b/example/main.py @@ -0,0 +1,61 @@ +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +import json +import numpy as np +import pandas as pd +import os +import glob +import sys +from time import time +from flask import Flask, request, jsonify +import tensorflow as tf +from pycld2 import detect +from polyglot.detect import Detector +import logging +import datetime +from logging.handlers import TimedRotatingFileHandler +import pickle + +app = Flask(__name__) + +@app.route("/",methods=["GET"]) +def index(): + return("App is running") + +@app.route("/patient", methods=["POST"]) +def patient(): + try: + name = request.form['name'] + age = request.form['age'] + gender = request.form['gender'] + illness = request.form['illness'] + + except Exception as e: + return "unable to create patient, error:", str(e) + + return jsonify({"name":name, "age":age, "gender":gender, "illness":illness}) + +@app.route("/doctor", methods=["POST"]) +def doctor(): + + try: + if 'diagnoses' in request.files: + diagnoses = request.files['diagnoses'] + print('one') + file_name = os.path.join("/home/raj/deep_evn/example", diagnoses.filename) + print(file_name) + diagnoses.save(file_name) + print('three') + + + medicine = request.form.get('medicine', "Not required") + + except Exception as e: + return "Unable to upload model file!, error:", str(e) + + return jsonify({"medicine":medicine, "file":file_name}) + + +if __name__ == '__main__': + app.run(debug=False, host= "0.0.0.0",port = 2542, use_reloader=False) diff --git a/example/req b/example/req new file mode 100644 index 0000000..d241f20 --- /dev/null +++ b/example/req @@ -0,0 +1,94 @@ +absl-py==0.7.1 +astor==0.7.1 +attrs==19.1.0 +backcall==0.1.0 +beautifulsoup4==4.7.1 +bleach==3.1.0 +bs4==0.0.1 +certifi==2019.3.9 +chardet==3.0.4 +colorama==0.4.1 +cycler==0.10.0 +decorator==4.4.0 +defusedxml==0.6.0 +ekphrasis==0.5.1 +entrypoints==0.3 +ftfy==5.5.1 +gast==0.2.2 +grpcio==1.20.0 +h5py==2.9.0 +idna==2.8 +ipykernel==5.1.0 +ipyparallel==6.2.3 +ipython==7.4.0 +ipython-genutils==0.2.0 +ipywidgets==7.4.2 +jedi==0.13.3 +Jinja2==2.10.1 +jsonschema==3.0.1 +jupyter-client==5.2.4 +jupyter-contrib-core==0.3.3 +jupyter-contrib-nbextensions==0.5.1 +jupyter-core==4.4.0 +jupyter-highlight-selected-word==0.2.0 +jupyter-latex-envs==1.4.6 +jupyter-nbextensions-configurator==0.4.1 +Keras==2.2.4 +Keras-Applications==1.0.7 +Keras-Preprocessing==1.0.9 +kiwisolver==1.0.1 +lxml==4.3.3 +Markdown==3.1 +MarkupSafe==1.1.1 +matplotlib==3.0.3 +mistune==0.8.4 +mock==2.0.0 +nbconvert==5.4.1 +nbformat==4.4.0 +nltk==3.4.1 +notebook==5.7.8 +numpy==1.16.3 +pandas==0.24.2 +pandocfilters==1.4.2 +parso==0.4.0 +pbr==5.1.3 +pexpect==4.7.0 +pickleshare==0.7.5 +plotly==3.8.1 +prometheus-client==0.6.0 +prompt-toolkit==2.0.9 +protobuf==3.7.1 +ptyprocess==0.6.0 +Pygments==2.3.1 +pymssql==2.1.4 +pyparsing==2.4.0 +pyrsistent==0.14.11 +python-dateutil==2.8.0 +pytz==2019.1 +PyYAML==5.1 +pyzmq==18.0.1 +requests==2.21.0 +retrying==1.3.3 +scikit-learn==0.20.3 +scipy==1.2.1 +seaborn==0.9.0 +Send2Trash==1.5.0 +six==1.12.0 +sklearn==0.0 +soupsieve==1.9.1 +tensorboard==1.13.1 +tensorflow==1.13.1 +tensorflow-estimator==1.13.0 +termcolor==1.1.0 +terminado==0.8.2 +testpath==0.4.2 +tornado==6.0.2 +tqdm==4.31.1 +traitlets==4.3.2 +ujson==1.35 +urllib3==1.24.2 +wcwidth==0.1.7 +webencodings==0.5.1 +Werkzeug==0.15.2 +xlrd==1.2.0 +widgetsnbextension==3.4.2 -- libgit2 0.21.2