Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -26,11 +26,11 @@ import transformers
|
|
26 |
token=st.secrets["HF_TOKEN"]
|
27 |
from huggingface_hub import login
|
28 |
login(token=st.secrets["HF_TOKEN"])
|
29 |
-
|
|
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
)
|
34 |
|
35 |
from langchain_community.document_loaders import TextLoader
|
36 |
from langchain_text_splitters import CharacterTextSplitter
|
|
|
26 |
token=st.secrets["HF_TOKEN"]
|
27 |
from huggingface_hub import login
|
28 |
login(token=st.secrets["HF_TOKEN"])
|
29 |
+
# Load model directly
|
30 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
31 |
|
32 |
+
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
|
33 |
+
model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
|
|
|
34 |
|
35 |
from langchain_community.document_loaders import TextLoader
|
36 |
from langchain_text_splitters import CharacterTextSplitter
|