Sahand commited on
Commit
6a04b7a
·
1 Parent(s): 5e11069

fixed host

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -1
  2. app.py +10 -1
Dockerfile CHANGED
@@ -3,4 +3,4 @@ WORKDIR /
3
  COPY ./requirements/requirements-dev-vis.txt /requirements-dev-vis.txt
4
  RUN pip install --no-cache-dir --upgrade -r /requirements-dev-vis.txt
5
  COPY . .
6
- CMD ["python", "app.py","--input","Data/{}"]
 
3
  COPY ./requirements/requirements-dev-vis.txt /requirements-dev-vis.txt
4
  RUN pip install --no-cache-dir --upgrade -r /requirements-dev-vis.txt
5
  COPY . .
6
+ CMD ["python", "app.py","--input","Data/{}","-s"]
app.py CHANGED
@@ -345,13 +345,22 @@ if __name__ == "__main__":
345
  help="Debug mode as True or False. Default is True.",
346
  default=True,
347
  )
 
 
 
 
 
 
348
 
349
  args = parser.parse_args()
350
  INPUT = args.input
351
 
352
  try:
353
  # dashapp.run_server(debug=args.debug)
354
- app.run(debug=args.debug)
 
 
 
355
  except Exception as e:
356
  vprint(
357
  0,
 
345
  help="Debug mode as True or False. Default is True.",
346
  default=True,
347
  )
348
+ parser.add_argument(
349
+ "-s",
350
+ "--spaces",
351
+ help="Whether running on huggingface spaces or not. Default is False.",
352
+ action=argparse.BooleanOptionalAction,
353
+ )
354
 
355
  args = parser.parse_args()
356
  INPUT = args.input
357
 
358
  try:
359
  # dashapp.run_server(debug=args.debug)
360
+ if args.spaces:
361
+ app.run(debug=args.debug, host="0.0.0.0", port=7860)
362
+ else:
363
+ app.run(debug=args.debug)
364
  except Exception as e:
365
  vprint(
366
  0,