allinaigc commited on
Commit
e41bb17
1 Parent(s): 6a6387e

Upload 5 files

Browse files
Files changed (3) hide show
  1. app.py +2 -15
  2. langchain_KB.py +1 -0
  3. requirements.txt +1 -0
app.py CHANGED
@@ -11,12 +11,12 @@
11
  ##TODO:
12
 
13
  # -*- coding: utf-8 -*-
14
- import requests
15
  import streamlit as st
16
  import openai
17
  import os
18
  import numpy as np
19
  import pandas as pd
 
20
  import csv
21
  import tempfile
22
  from tempfile import NamedTemporaryFile
@@ -24,36 +24,23 @@ import pathlib
24
  from pathlib import Path
25
  import re
26
  from re import sub
27
- import matplotlib.pyplot as plt
28
  from itertools import product
29
- from tqdm import tqdm_notebook, tqdm, trange
30
  import time
31
  from time import sleep
32
- from matplotlib.pyplot import style
33
- from rich import print
34
- import warnings
35
  import streamlit_authenticator as stauth
36
- # from langchain.vectorstores import FAISS
37
  from langchain_community.vectorstores import FAISS
38
  from langchain.embeddings.huggingface import HuggingFaceEmbeddings
39
  from langchain_core.output_parsers import StrOutputParser
40
  from langchain_core.runnables import RunnablePassthrough
41
- from langchain_core.runnables import RunnableParallel
42
  from langchain.llms.base import LLM
43
  from langchain.llms.utils import enforce_stop_tokens
44
  from typing import Dict, List, Optional, Tuple, Union
45
  import requests
46
- import json
47
  import streamlit as st
48
- # import rag_reponse_001
49
  import qwen_response
50
  import rag_reponse_002
51
- # import chatgpt
52
- # from st_copy_to_clipboard import st_copy_to_clipboard
53
- import clipboard
54
  import dashscope
55
  from dotenv import load_dotenv
56
- # warnings.filterwarnings('ignore')
57
  from datetime import datetime
58
  import pytz
59
  from pytz import timezone
@@ -74,7 +61,7 @@ dashscope.api_key = os.environ['dashscope_api_key']
74
 
75
  ### Streamlit页面设定。
76
  st.set_page_config(layout="wide")
77
- st.title("本地化国产大模型智能知识库查询演示")
78
  # st.title("大语言模型智能知识库查询中心")
79
  # st.title("大语言模型本地知识库问答系统")
80
  # st.subheader("Large Language Model-based Knowledge Base QA System")
 
11
  ##TODO:
12
 
13
  # -*- coding: utf-8 -*-
 
14
  import streamlit as st
15
  import openai
16
  import os
17
  import numpy as np
18
  import pandas as pd
19
+
20
  import csv
21
  import tempfile
22
  from tempfile import NamedTemporaryFile
 
24
  from pathlib import Path
25
  import re
26
  from re import sub
 
27
  from itertools import product
 
28
  import time
29
  from time import sleep
 
 
 
30
  import streamlit_authenticator as stauth
 
31
  from langchain_community.vectorstores import FAISS
32
  from langchain.embeddings.huggingface import HuggingFaceEmbeddings
33
  from langchain_core.output_parsers import StrOutputParser
34
  from langchain_core.runnables import RunnablePassthrough
 
35
  from langchain.llms.base import LLM
36
  from langchain.llms.utils import enforce_stop_tokens
37
  from typing import Dict, List, Optional, Tuple, Union
38
  import requests
 
39
  import streamlit as st
 
40
  import qwen_response
41
  import rag_reponse_002
 
 
 
42
  import dashscope
43
  from dotenv import load_dotenv
 
44
  from datetime import datetime
45
  import pytz
46
  from pytz import timezone
 
61
 
62
  ### Streamlit页面设定。
63
  st.set_page_config(layout="wide")
64
+ st.title("本地化国产大模型知识库查询演示")
65
  # st.title("大语言模型智能知识库查询中心")
66
  # st.title("大语言模型本地知识库问答系统")
67
  # st.subheader("Large Language Model-based Knowledge Base QA System")
langchain_KB.py CHANGED
@@ -16,6 +16,7 @@ import tempfile
16
  from tempfile import NamedTemporaryFile
17
  import pathlib
18
  from pathlib import Path
 
19
  import re
20
  from re import sub
21
  import time
 
16
  from tempfile import NamedTemporaryFile
17
  import pathlib
18
  from pathlib import Path
19
+ import pypdf
20
  import re
21
  from re import sub
22
  import time
requirements.txt CHANGED
@@ -9,6 +9,7 @@ openai==1.25.0
9
  pandas==2.2.2
10
  pretty_errors==1.2.25
11
  PyPDF2==3.0.1
 
12
  python-dotenv==1.0.1
13
  pytz==2024.1
14
  PyYAML==6.0.1
 
9
  pandas==2.2.2
10
  pretty_errors==1.2.25
11
  PyPDF2==3.0.1
12
+ pypdf
13
  python-dotenv==1.0.1
14
  pytz==2024.1
15
  PyYAML==6.0.1