Spaces:
Paused
Paused
Upload folder using huggingface_hub
Browse files- 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 |
-
|
|
|
44 |
else:
|
45 |
-
hist.append({"role":
|
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 = [
|