Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -516,7 +516,6 @@ if __name__ == "__main__":
|
|
| 516 |
parser = argparse.ArgumentParser()
|
| 517 |
parser.add_argument("--host", type=str, default="127.0.0.1")
|
| 518 |
parser.add_argument("--port", type=int)
|
| 519 |
-
parser.add_argument("--controller-url", type=str, default="http://localhost:21001")
|
| 520 |
parser.add_argument("--concurrency-count", type=int, default=10)
|
| 521 |
parser.add_argument("--model-list-mode", type=str, default="once",
|
| 522 |
choices=["once", "reload"])
|
|
@@ -529,7 +528,6 @@ if __name__ == "__main__":
|
|
| 529 |
models = get_model_list()
|
| 530 |
logger.info(args)
|
| 531 |
|
| 532 |
-
model_path = os.getenv("model", "liuhaotian/llava-v1.6-mistral-7b")
|
| 533 |
concurrency_count = int(os.getenv("concurrency_count", 5))
|
| 534 |
|
| 535 |
controller_proc = start_controller()
|
|
@@ -537,19 +535,19 @@ if __name__ == "__main__":
|
|
| 537 |
worker_proc = start_worker(model_path)
|
| 538 |
time.sleep(10)
|
| 539 |
exit_status = 0
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
except Exception as e:
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
finally:
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
|
|
|
| 516 |
parser = argparse.ArgumentParser()
|
| 517 |
parser.add_argument("--host", type=str, default="127.0.0.1")
|
| 518 |
parser.add_argument("--port", type=int)
|
|
|
|
| 519 |
parser.add_argument("--concurrency-count", type=int, default=10)
|
| 520 |
parser.add_argument("--model-list-mode", type=str, default="once",
|
| 521 |
choices=["once", "reload"])
|
|
|
|
| 528 |
models = get_model_list()
|
| 529 |
logger.info(args)
|
| 530 |
|
|
|
|
| 531 |
concurrency_count = int(os.getenv("concurrency_count", 5))
|
| 532 |
|
| 533 |
controller_proc = start_controller()
|
|
|
|
| 535 |
worker_proc = start_worker(model_path)
|
| 536 |
time.sleep(10)
|
| 537 |
exit_status = 0
|
| 538 |
+
|
| 539 |
+
demo = build_demo(args.embed)
|
| 540 |
+
demo.launch(
|
| 541 |
+
server_name=args.host,
|
| 542 |
+
server_port=args.port,
|
| 543 |
+
share=args.share,
|
| 544 |
+
debug=True,
|
| 545 |
+
max_threads=10)
|
| 546 |
+
# )
|
| 547 |
+
# except Exception as e:
|
| 548 |
+
# print(e)
|
| 549 |
+
# exit_status = 1
|
| 550 |
+
# finally:
|
| 551 |
+
# worker_proc.kill()
|
| 552 |
+
# controller_proc.kill()
|
| 553 |
+
# sys.exit(exit_status)
|