Spaces:
Build error
Build error
Commit
·
970c817
1
Parent(s):
41bf20d
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
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))
|