regraded01 commited on
Commit
5aaa965
·
1 Parent(s): 5245b11

feat: init a streamlit dashboard (non-functional)

Browse files
Files changed (1) hide show
  1. app_langchain.py +8 -3
app_langchain.py CHANGED
@@ -1,6 +1,8 @@
1
  from langchain_core.prompts import ChatPromptTemplate
2
  from langchain_core.runnables import RunnablePassthrough
3
 
 
 
4
  from src.utils import load_config_values
5
  from src.dev_llm import FakeLLM
6
 
@@ -18,12 +20,10 @@ system_message, context_message, model_id = load_config_values(
18
  ]
19
  )
20
 
21
-
22
  prompt = ChatPromptTemplate.from_template(
23
  template=context_message,
24
  )
25
 
26
-
27
  chain = (
28
  {
29
  "system_message": lambda x: system_message,
@@ -34,4 +34,9 @@ chain = (
34
  |tmp_llm
35
  )
36
 
37
- print(chain.invoke("{\"appointment_date\"}"))
 
 
 
 
 
 
1
  from langchain_core.prompts import ChatPromptTemplate
2
  from langchain_core.runnables import RunnablePassthrough
3
 
4
+ import streamlit as st
5
+
6
  from src.utils import load_config_values
7
  from src.dev_llm import FakeLLM
8
 
 
20
  ]
21
  )
22
 
 
23
  prompt = ChatPromptTemplate.from_template(
24
  template=context_message,
25
  )
26
 
 
27
  chain = (
28
  {
29
  "system_message": lambda x: system_message,
 
34
  |tmp_llm
35
  )
36
 
37
+ st.file_uploader(
38
+ label="Upload PDF:\n",
39
+ type=".pdf"
40
+ )
41
+
42
+ st.text(chain.invoke("{\"appointment_date\"}"))