Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +3 -3
src/streamlit_app.py
CHANGED
|
@@ -17,7 +17,8 @@ try:
|
|
| 17 |
from huggingface_hub import InferenceClient
|
| 18 |
except ImportError:
|
| 19 |
st.error("請檢查是否安裝了所有 Hugging Face 相關依賴:pip install huggingface-hub")
|
| 20 |
-
|
|
|
|
| 21 |
# === LangChain/RAG 相關套件 (保持不變) ===
|
| 22 |
from langchain_community.embeddings import HuggingFaceEmbeddings
|
| 23 |
from langchain_core.documents import Document
|
|
@@ -318,8 +319,7 @@ def load_inference_client(model_id):
|
|
| 318 |
trust_remote_code=True
|
| 319 |
)
|
| 320 |
|
| 321 |
-
|
| 322 |
-
import torch
|
| 323 |
|
| 324 |
bnb = BitsAndBytesConfig(
|
| 325 |
load_in_4bit=True,
|
|
|
|
| 17 |
from huggingface_hub import InferenceClient
|
| 18 |
except ImportError:
|
| 19 |
st.error("請檢查是否安裝了所有 Hugging Face 相關依賴:pip install huggingface-hub")
|
| 20 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
|
| 21 |
+
import torch
|
| 22 |
# === LangChain/RAG 相關套件 (保持不變) ===
|
| 23 |
from langchain_community.embeddings import HuggingFaceEmbeddings
|
| 24 |
from langchain_core.documents import Document
|
|
|
|
| 319 |
trust_remote_code=True
|
| 320 |
)
|
| 321 |
|
| 322 |
+
|
|
|
|
| 323 |
|
| 324 |
bnb = BitsAndBytesConfig(
|
| 325 |
load_in_4bit=True,
|