Update app.py
Browse files
app.py
CHANGED
@@ -4,9 +4,12 @@ from langchain_community.embeddings import SentenceTransformerEmbeddings
|
|
4 |
from langchain.vectorstores import FAISS
|
5 |
import numpy as np
|
6 |
|
|
|
|
|
|
|
7 |
# 1. 初始化 Gemma 模型
|
8 |
try:
|
9 |
-
llm = HuggingFaceHub(repo_id=
|
10 |
except Exception as e:
|
11 |
st.error(f"Gemma 模型加载失败:{e}")
|
12 |
st.stop()
|
|
|
4 |
from langchain.vectorstores import FAISS
|
5 |
import numpy as np
|
6 |
|
7 |
+
# gemma = 'google/gemma-7b-it';
|
8 |
+
gemma = 'google/recurrentgemma-2b-it';
|
9 |
+
|
10 |
# 1. 初始化 Gemma 模型
|
11 |
try:
|
12 |
+
llm = HuggingFaceHub(repo_id=gemma, model_kwargs={"temperature": 0.5, "max_length": 512})
|
13 |
except Exception as e:
|
14 |
st.error(f"Gemma 模型加载失败:{e}")
|
15 |
st.stop()
|