Spaces:
Runtime error
Runtime error
Commit
·
94d66a9
1
Parent(s):
d52bfd5
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,11 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
|
| 5 |
model_name = "https://huggingface.co/spaces/DR-Rakshitha/wizardlm_api/blob/main/pytorch_model-00001-of-00002.bin"
|
| 6 |
|
| 7 |
# Initialize the tokenizer
|
| 8 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name, local_files_only=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
# Initialize the GPT4All model
|
| 11 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
|
|
|
| 5 |
model_name = "https://huggingface.co/spaces/DR-Rakshitha/wizardlm_api/blob/main/pytorch_model-00001-of-00002.bin"
|
| 6 |
|
| 7 |
# Initialize the tokenizer
|
| 8 |
+
# tokenizer = AutoTokenizer.from_pretrained(model_name, local_files_only=True)
|
| 9 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
| 10 |
+
tokenizer.pad_token = tokenizer.eos_token
|
| 11 |
+
tokenizer.padding_side = "right"
|
| 12 |
+
|
| 13 |
|
| 14 |
# Initialize the GPT4All model
|
| 15 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|