Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -16,12 +16,19 @@ from langchain.schema.runnable import RunnablePassthrough
|
|
16 |
from langchain.llms import HuggingFacePipeline
|
17 |
from langchain.chains import LLMChain
|
18 |
import transformers
|
19 |
-
model_name='mistralai/Mistral-7B-Instruct-v0.1'
|
20 |
|
|
|
|
|
|
|
|
|
21 |
model_config = transformers.AutoConfig.from_pretrained(
|
22 |
model_name,
|
23 |
)
|
24 |
|
|
|
|
|
|
|
|
|
25 |
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
26 |
tokenizer.pad_token = tokenizer.eos_token
|
27 |
tokenizer.padding_side = "right"
|
|
|
16 |
from langchain.llms import HuggingFacePipeline
|
17 |
from langchain.chains import LLMChain
|
18 |
import transformers
|
|
|
19 |
|
20 |
+
import transformers
|
21 |
+
model_name='mistralai/Mistral-7B-Instruct-v0.1'
|
22 |
+
from huggingface_hub import login
|
23 |
+
login(token = 'HF_TOKEN')
|
24 |
model_config = transformers.AutoConfig.from_pretrained(
|
25 |
model_name,
|
26 |
)
|
27 |
|
28 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
29 |
+
tokenizer.pad_token = tokenizer.eos_token
|
30 |
+
tokenizer.padding_side = "right"
|
31 |
+
|
32 |
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
33 |
tokenizer.pad_token = tokenizer.eos_token
|
34 |
tokenizer.padding_side = "right"
|