Spaces:
Runtime error
Runtime error
Davidsamuel101
commited on
Commit
•
0752d04
1
Parent(s):
b480d8d
Update Some Logs
Browse files- src/app.py +4 -6
src/app.py
CHANGED
@@ -30,8 +30,7 @@ def summarize(slides):
|
|
30 |
summary = tokenizer.batch_decode(tensor, skip_special_tokens=True)[0]
|
31 |
contents[idx] = (tag, summary)
|
32 |
except Exception as e:
|
33 |
-
print(e)
|
34 |
-
print("Summarization Fails")
|
35 |
return generated_slides
|
36 |
|
37 |
def convert2markdown(generated_slides):
|
@@ -54,15 +53,14 @@ def inference(document):
|
|
54 |
global FILENAME
|
55 |
doc = fitz.open(document)
|
56 |
FILENAME = document.name.split('/')[-1].split('.')[0]
|
57 |
-
print(f"FILENAME: {FILENAME}")
|
58 |
font_counts, styles = preprocess.get_font_info(doc, granularity=False)
|
59 |
size_tag = preprocess.get_font_tags(font_counts, styles)
|
60 |
texts = preprocess.assign_tags(doc, size_tag)
|
61 |
slides = preprocess.get_slides(texts)
|
62 |
generated_slides = summarize(slides)
|
63 |
-
|
64 |
-
print(f"Markdown
|
65 |
-
return
|
66 |
|
67 |
|
68 |
with gr.Blocks() as demo:
|
|
|
30 |
summary = tokenizer.batch_decode(tensor, skip_special_tokens=True)[0]
|
31 |
contents[idx] = (tag, summary)
|
32 |
except Exception as e:
|
33 |
+
print(f"Summarization Fails, Error: {e}")
|
|
|
34 |
return generated_slides
|
35 |
|
36 |
def convert2markdown(generated_slides):
|
|
|
53 |
global FILENAME
|
54 |
doc = fitz.open(document)
|
55 |
FILENAME = document.name.split('/')[-1].split('.')[0]
|
|
|
56 |
font_counts, styles = preprocess.get_font_info(doc, granularity=False)
|
57 |
size_tag = preprocess.get_font_tags(font_counts, styles)
|
58 |
texts = preprocess.assign_tags(doc, size_tag)
|
59 |
slides = preprocess.get_slides(texts)
|
60 |
generated_slides = summarize(slides)
|
61 |
+
markdown_name = convert2markdown(generated_slides)
|
62 |
+
print(f"Markdown File Name: {markdown_name}")
|
63 |
+
return markdown_name
|
64 |
|
65 |
|
66 |
with gr.Blocks() as demo:
|