ahmedheakl commited on
Commit
2caebf1
·
verified ·
1 Parent(s): 0035a5e

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. gradio_app.py +4 -2
gradio_app.py CHANGED
@@ -39,10 +39,12 @@ def load_chat(
39
  hist = []
40
  for i, h in enumerate(history):
41
  content = h.get("content", "")
 
42
  if isinstance(content, tuple):
43
- hist.append({"role": "user", "content": [{"type": "image_url", "image_url": {"url": get_gradio_url(content[0])}}]})
 
44
  else:
45
- hist.append({"role": "user", "content": [{"type": "text", "text": content}]})
46
  history = hist
47
  files = message.get('files', [])
48
  content = [
 
39
  hist = []
40
  for i, h in enumerate(history):
41
  content = h.get("content", "")
42
+ role = h.get("role", "")
43
  if isinstance(content, tuple):
44
+ src_path = content[0]
45
+ hist.append({"role": role, "content": [{"type": "image_url", "image_url": {"url": get_gradio_url(content[0])}}]})
46
  else:
47
+ hist.append({"role": role, "content": [{"type": "text", "text": content}]})
48
  history = hist
49
  files = message.get('files', [])
50
  content = [