Spaces:
Runtime error
Runtime error
BenBranyon
commited on
Commit
•
486e10d
1
Parent(s):
44d2c87
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import AutoTokenizer
|
2 |
+
import transformers
|
3 |
+
import torch
|
4 |
+
|
5 |
+
model = "tiiuae/falcon-7b-instruct"
|
6 |
+
|
7 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
8 |
+
pipeline = transformers.pipeline(
|
9 |
+
"text-generation",
|
10 |
+
model=model,
|
11 |
+
tokenizer=tokenizer,
|
12 |
+
torch_dtype=torch.bfloat16,
|
13 |
+
trust_remote_code=True,
|
14 |
+
device_map="auto",
|
15 |
+
)
|