Charles Chan
commited on
Commit
·
4020981
1
Parent(s):
e7ecc02
war
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
from langchain_community.llms import HuggingFaceHub
|
3 |
-
from
|
4 |
from langchain.vectorstores import FAISS
|
5 |
|
6 |
# 1. 初始化 Gemma 模型
|
@@ -40,7 +40,7 @@ def answer_question(question):
|
|
40 |
prompt = f"请根据以下知识库回答问题:\n{context}\n问题:{question}"
|
41 |
print(prompt)
|
42 |
|
43 |
-
answer = llm(prompt)
|
44 |
return answer
|
45 |
except Exception as e:
|
46 |
st.error(f"问答过程出错:{e}")
|
|
|
1 |
import streamlit as st
|
2 |
from langchain_community.llms import HuggingFaceHub
|
3 |
+
from langchain_community.embeddings import SentenceTransformerEmbeddings
|
4 |
from langchain.vectorstores import FAISS
|
5 |
|
6 |
# 1. 初始化 Gemma 模型
|
|
|
40 |
prompt = f"请根据以下知识库回答问题:\n{context}\n问题:{question}"
|
41 |
print(prompt)
|
42 |
|
43 |
+
answer = "123" #llm(prompt)
|
44 |
return answer
|
45 |
except Exception as e:
|
46 |
st.error(f"问答过程出错:{e}")
|