Update file_viewer_panel.py
Browse files- file_viewer_panel.py +2 -2
file_viewer_panel.py
CHANGED
|
@@ -4,7 +4,7 @@ import shutil
|
|
| 4 |
import json
|
| 5 |
import tempfile
|
| 6 |
from pdf2image import convert_from_path
|
| 7 |
-
from gradio.
|
| 8 |
from file_utils import extract_text_from_file, call_llm, save_user_file, fetch_user_files
|
| 9 |
|
| 10 |
def file_viewer_dashboard(nickname):
|
|
@@ -49,7 +49,7 @@ def file_viewer_dashboard(nickname):
|
|
| 49 |
for i, img in enumerate(images):
|
| 50 |
img_path = os.path.join(temp_dir, f"page_{i}.png")
|
| 51 |
img.save(img_path, "PNG")
|
| 52 |
-
gr_img_path =
|
| 53 |
paths.append(gr_img_path)
|
| 54 |
|
| 55 |
initial_html = "".join([
|
|
|
|
| 4 |
import json
|
| 5 |
import tempfile
|
| 6 |
from pdf2image import convert_from_path
|
| 7 |
+
from gradio.files import move_to_cache
|
| 8 |
from file_utils import extract_text_from_file, call_llm, save_user_file, fetch_user_files
|
| 9 |
|
| 10 |
def file_viewer_dashboard(nickname):
|
|
|
|
| 49 |
for i, img in enumerate(images):
|
| 50 |
img_path = os.path.join(temp_dir, f"page_{i}.png")
|
| 51 |
img.save(img_path, "PNG")
|
| 52 |
+
gr_img_path = move_to_cache(img_path)
|
| 53 |
paths.append(gr_img_path)
|
| 54 |
|
| 55 |
initial_html = "".join([
|