Spaces:
Paused
Paused
Update gradio_app.py
Browse files- gradio_app.py +3 -0
gradio_app.py
CHANGED
|
@@ -12,6 +12,9 @@ TOP_N_HISTORY = 2
|
|
| 12 |
LOGO_PATH = "https://huggingface.co/spaces/ahmedheakl/AIN-Arabic-VLM/resolve/main/logo.jpeg"
|
| 13 |
|
| 14 |
def get_gradio_url(path: str) -> str:
|
|
|
|
|
|
|
|
|
|
| 15 |
return f"https://{USERNAME}-{SPACE_NAME}.hf.space/gradio_api/file={path}"
|
| 16 |
|
| 17 |
def history_to_messages(history: list) -> list:
|
|
|
|
| 12 |
LOGO_PATH = "https://huggingface.co/spaces/ahmedheakl/AIN-Arabic-VLM/resolve/main/logo.jpeg"
|
| 13 |
|
| 14 |
def get_gradio_url(path: str) -> str:
|
| 15 |
+
# If path is already an absolute URL, return it as is.
|
| 16 |
+
if path.startswith("http"):
|
| 17 |
+
return path
|
| 18 |
return f"https://{USERNAME}-{SPACE_NAME}.hf.space/gradio_api/file={path}"
|
| 19 |
|
| 20 |
def history_to_messages(history: list) -> list:
|