Upload 9 files
Browse files
app.py
CHANGED
@@ -6,15 +6,26 @@ from docx import Document
|
|
6 |
from docx.shared import Pt
|
7 |
from fpdf import FPDF
|
8 |
|
9 |
-
|
10 |
-
from .
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
|
20 |
class LoggedComponents(TypedDict):
|
@@ -583,12 +594,9 @@ def build_feedback(components: LoggedComponents) -> gr.Blocks:
|
|
583 |
|
584 |
def build_demo():
|
585 |
logger, drafter = build_drafter()
|
586 |
-
# compliancy_check = build_compliancy_check()
|
587 |
feedback = build_feedback(logger)
|
588 |
|
589 |
return gr.TabbedInterface(
|
590 |
-
# interface_list=[drafter, compliancy_check, feedback],
|
591 |
-
# tab_names=["LOI writer", "Compliancy Check", "Feedback"],
|
592 |
interface_list=[drafter, feedback],
|
593 |
tab_names=["LOI writer", "Feedback"],
|
594 |
title="Candid's letter of intent (LOI) writer",
|
@@ -602,7 +610,6 @@ if __name__ == '__main__':
|
|
602 |
show_api=False,
|
603 |
auth=[
|
604 |
(os.getenv("APP_USERNAME"), os.getenv("APP_PASSWORD")),
|
605 |
-
# can add more username / password pairs
|
606 |
],
|
607 |
auth_message="Login to Candid's letter of intent demo"
|
608 |
)
|
|
|
6 |
from docx.shared import Pt
|
7 |
from fpdf import FPDF
|
8 |
|
9 |
+
try:
|
10 |
+
from .editor import create_editable_section, update_highlighted_text
|
11 |
+
from .services import (
|
12 |
+
organization_pair_autofill,
|
13 |
+
cost_estimator,
|
14 |
+
draft_letter,
|
15 |
+
help_mission_statement,
|
16 |
+
send_feedback
|
17 |
+
)
|
18 |
+
from .constants import JS, CATEGORIES
|
19 |
+
except ImportError:
|
20 |
+
from editor import create_editable_section, update_highlighted_text
|
21 |
+
from services import (
|
22 |
+
organization_pair_autofill,
|
23 |
+
cost_estimator,
|
24 |
+
draft_letter,
|
25 |
+
help_mission_statement,
|
26 |
+
send_feedback
|
27 |
+
)
|
28 |
+
from constants import JS, CATEGORIES
|
29 |
|
30 |
|
31 |
class LoggedComponents(TypedDict):
|
|
|
594 |
|
595 |
def build_demo():
|
596 |
logger, drafter = build_drafter()
|
|
|
597 |
feedback = build_feedback(logger)
|
598 |
|
599 |
return gr.TabbedInterface(
|
|
|
|
|
600 |
interface_list=[drafter, feedback],
|
601 |
tab_names=["LOI writer", "Feedback"],
|
602 |
title="Candid's letter of intent (LOI) writer",
|
|
|
610 |
show_api=False,
|
611 |
auth=[
|
612 |
(os.getenv("APP_USERNAME"), os.getenv("APP_PASSWORD")),
|
|
|
613 |
],
|
614 |
auth_message="Login to Candid's letter of intent demo"
|
615 |
)
|
editor.py
CHANGED
@@ -3,7 +3,10 @@ import logging
|
|
3 |
|
4 |
import gradio as gr
|
5 |
|
6 |
-
|
|
|
|
|
|
|
7 |
|
8 |
|
9 |
def create_editable_section(label, js_script, submit_fn, textbox):
|
|
|
3 |
|
4 |
import gradio as gr
|
5 |
|
6 |
+
try:
|
7 |
+
from .services import identify_vague_statements
|
8 |
+
except ImportError:
|
9 |
+
from services import identify_vague_statements
|
10 |
|
11 |
|
12 |
def create_editable_section(label, js_script, submit_fn, textbox):
|