snsynth commited on
Commit
f05dd37
·
1 Parent(s): 97eaf08

update docker

Browse files
.gitattributes CHANGED
@@ -35,3 +35,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  models/all-MiniLM-L6-v2/model.safetensors filter=lfs diff=lfs merge=lfs -text
37
  models/Llama-3.2-1B-Instruct-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
 
 
 
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  models/all-MiniLM-L6-v2/model.safetensors filter=lfs diff=lfs merge=lfs -text
37
  models/Llama-3.2-1B-Instruct-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
38
+ data/annual-report-of-fy-2022-23.pdf filter=lfs diff=lfs merge=lfs -text
39
+ data/reliance-jio-infocomm-limited-annual-report-fy-2023-24.pdf filter=lfs diff=lfs merge=lfs -text
app.py ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import mesop as me
2
+ from rag_app.chat_utils import State, _make_style_chat_bubble_wrapper, _ROLE_ASSISTANT, on_chat_input, _make_chat_bubble_style, \
3
+ on_click_submit_chat_msg, _STYLE_CHAT_BUBBLE_NAME, handle_pdf_upload
4
+
5
+ _COLOR_BACKGROUND = me.theme_var("background")
6
+
7
+ _STYLE_APP_CONTAINER = me.Style(
8
+ background=_COLOR_BACKGROUND,
9
+ display="flex",
10
+ flex_direction="column",
11
+ height="100%",
12
+ margin=me.Margin.symmetric(vertical=0, horizontal="auto"),
13
+ width="min(1024px, 100%)",
14
+ box_shadow="0 3px 1px -2px #0003, 0 2px 2px #00000024, 0 1px 5px #0000001f",
15
+ padding=me.Padding(top=20, left=20, right=20),
16
+ )
17
+
18
+
19
+ @me.page()
20
+ def app():
21
+ state = me.state(State)
22
+ with me.box(style=_STYLE_APP_CONTAINER):
23
+ with me.box(style=me.Style(
24
+ width="min(680%, 100%)",
25
+ margin=me.Margin.symmetric(vertical=36, horizontal="auto"),
26
+ flex_grow=1,
27
+ overflow_y="auto",
28
+ padding=me.Padding(left=20, right=20)
29
+ )):
30
+ me.text("""
31
+ FinanceGPT - Powered by open source language models capable of document QnA on Annual
32
+ Investor Reports of top companies.
33
+ """,
34
+ style=me.Style(font_size=20, margin=me.Margin(bottom=24), text_align="center")
35
+ )
36
+ me.text("ℹ️ Upload annual reports to start asking questions.",
37
+ style=me.Style(font_size=12, margin=me.Margin(bottom=24), text_align="center")
38
+ )
39
+ for index, msg in enumerate(state.output):
40
+ with me.box(style=_make_style_chat_bubble_wrapper(msg.role), key=f"msg-{index}"):
41
+ if msg.role == _ROLE_ASSISTANT:
42
+ me.text("assistant", style=_STYLE_CHAT_BUBBLE_NAME)
43
+ with me.box(style=_make_chat_bubble_style(msg.role)):
44
+ me.markdown(msg.content)
45
+ if state.in_progress:
46
+ me.progress_spinner()
47
+ with me.box(key="scroll-to", style=me.Style(height=250)):
48
+ pass
49
+ with me.box(style=me.Style(
50
+ padding=me.Padding(top=30, left=20, right=20),
51
+ display="flex",
52
+ flex_direction="row"
53
+ )):
54
+ with me.content_uploader(
55
+ accepted_file_types=["application/pdf"],
56
+ on_upload=handle_pdf_upload,
57
+ type="icon",
58
+ style=me.Style(font_weight="bold", margin=me.Margin(right=8)),
59
+ ):
60
+ me.icon("attach_file")
61
+
62
+ with me.box(style=me.Style(flex_grow=1)):
63
+ me.input(
64
+ label="Enter your prompt",
65
+ key=f"input-{len(state.output)}",
66
+ on_input=on_chat_input,
67
+ on_enter=on_click_submit_chat_msg,
68
+ style=me.Style(width="100%")
69
+ )
70
+ with me.content_button(
71
+ color="primary",
72
+ type="flat",
73
+ disabled=state.in_progress,
74
+ on_click=on_click_submit_chat_msg,
75
+ style=me.Style(margin=me.Margin(top=8, left=8))
76
+ ):
77
+ me.icon("send" if not state.in_progress else "pending")
data/annual-report-of-fy-2022-23.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d19da902ce136fb917a1f4f38552503b8f12c44c810746b1304e14f17ec9b837
3
+ size 2839030
data/reliance-jio-infocomm-limited-annual-report-fy-2023-24.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c64ee5f25bb2de318f7bfc65cc0c30a26c64222f74bcbdb61f70b727e5679ce
3
+ size 2446064