Update app.py
Browse files
app.py
CHANGED
|
@@ -12,9 +12,6 @@ from transformers import (
|
|
| 12 |
LlamaTokenizer,
|
| 13 |
)
|
| 14 |
|
| 15 |
-
|
| 16 |
-
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 17 |
-
|
| 18 |
MAX_MAX_NEW_TOKENS = 1024
|
| 19 |
DEFAULT_MAX_NEW_TOKENS = 50
|
| 20 |
MAX_INPUT_TOKEN_LENGTH = 512
|
|
@@ -29,7 +26,9 @@ For additional detail on the model, including a link to the arXiv paper, refer t
|
|
| 29 |
|
| 30 |
model = AutoModelForCausalLM.from_pretrained(
|
| 31 |
"microsoft/Phi-3-mini-4k-instruct",
|
| 32 |
-
|
|
|
|
|
|
|
| 33 |
)
|
| 34 |
tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-4k-instruct")
|
| 35 |
|
|
|
|
| 12 |
LlamaTokenizer,
|
| 13 |
)
|
| 14 |
|
|
|
|
|
|
|
|
|
|
| 15 |
MAX_MAX_NEW_TOKENS = 1024
|
| 16 |
DEFAULT_MAX_NEW_TOKENS = 50
|
| 17 |
MAX_INPUT_TOKEN_LENGTH = 512
|
|
|
|
| 26 |
|
| 27 |
model = AutoModelForCausalLM.from_pretrained(
|
| 28 |
"microsoft/Phi-3-mini-4k-instruct",
|
| 29 |
+
device_map="cuda",
|
| 30 |
+
torch_dtype="auto",
|
| 31 |
+
trust_remote_code=True,
|
| 32 |
)
|
| 33 |
tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-4k-instruct")
|
| 34 |
|