JJteam commited on
Commit
2014e63
1 Parent(s): 0ece5f8

minor fix in image path

Browse files
Files changed (1) hide show
  1. MM-REACT/app.py +5 -3
MM-REACT/app.py CHANGED
@@ -329,7 +329,10 @@ def add_image(state, chain, image, log_state):
329
  global ARGS
330
  state = state or []
331
 
332
- url_input_for_chain = "http://0.0.0.0:{}/file={}".format(ARGS.port, image.name)
 
 
 
333
 
334
  outputs = run_chain(chain, url_input_for_chain)
335
 
@@ -339,8 +342,7 @@ def add_image(state, chain, image, log_state):
339
 
340
  for i, output in enumerate(outputs):
341
  if i==0:
342
- # state.append((f"![](/file={image.name})", output))
343
- state.append(((image.name,), output))
344
  else:
345
  state.append((None, output))
346
 
 
329
  global ARGS
330
  state = state or []
331
 
332
+ # handling spaces in image path
333
+ imagepath = image.name.replace(" ", "%20")
334
+
335
+ url_input_for_chain = "http://0.0.0.0:{}/file={}".format(ARGS.port, imagepath)
336
 
337
  outputs = run_chain(chain, url_input_for_chain)
338
 
 
342
 
343
  for i, output in enumerate(outputs):
344
  if i==0:
345
+ state.append(((imagepath,), output))
 
346
  else:
347
  state.append((None, output))
348