johnpaulbin commited on
Commit
970c817
·
1 Parent(s): 41bf20d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -12,6 +12,8 @@ from pprint import pprint
12
  from tqdm import tqdm
13
  from flask import Flask, request, jsonify
14
  import asyncio
 
 
15
 
16
  app = Flask(__name__)
17
 
@@ -368,6 +370,7 @@ def download_model():
368
  result = loop.run_until_complete(get_build().download_model(model_id))
369
  return jsonify(result)
370
 
371
- # More endpoints for other methods
372
  if __name__ == "__main__":
373
- hypercorn.run(app, host='0.0.0.0', port=7860)
 
 
 
12
  from tqdm import tqdm
13
  from flask import Flask, request, jsonify
14
  import asyncio
15
+ from hypercorn.asyncio import serve
16
+ from hypercorn.config import Config
17
 
18
  app = Flask(__name__)
19
 
 
370
  result = loop.run_until_complete(get_build().download_model(model_id))
371
  return jsonify(result)
372
 
 
373
  if __name__ == "__main__":
374
+ config = Config()
375
+ config.bind = ["0.0.0.0:7860"] # You can specify the host and port here
376
+ asyncio.run(serve(app, config))