Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,13 +2,14 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
| 2 |
import transformers
|
| 3 |
import torch
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
|
|
|
|
| 7 |
|
| 8 |
model = AutoModelForCausalLM.from_pretrained(
|
| 9 |
-
|
| 10 |
|
| 11 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
| 12 |
pipeline = transformers.pipeline(
|
| 13 |
"text-generation",
|
| 14 |
model=model,
|
|
|
|
| 2 |
import transformers
|
| 3 |
import torch
|
| 4 |
|
| 5 |
+
# checkpoint = "tiiuae/falcon-40b-instruct"
|
| 6 |
+
# checkpoint = "tiiuae/falcon-7b-instruct"
|
| 7 |
+
checkpoint = "microsoft/phi-1_5"
|
| 8 |
|
| 9 |
model = AutoModelForCausalLM.from_pretrained(
|
| 10 |
+
checkpoint, device_map="auto", offload_folder="offload", trust_remote_code=True)
|
| 11 |
|
| 12 |
+
tokenizer = AutoTokenizer.from_pretrained(checkpoint, )
|
| 13 |
pipeline = transformers.pipeline(
|
| 14 |
"text-generation",
|
| 15 |
model=model,
|