Skip to content

Commit 2d7c901

Browse files
committed
review comments
Signed-off-by: Akihiko Kuroda <akihikokuroda2020@gmail.com>
1 parent 6aee3b5 commit 2d7c901

2 files changed

Lines changed: 513 additions & 11 deletions

File tree

docs/examples/intrinsics/intrinsics.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# pytest: huggingface, requires_heavy_ram, llm
22

3-
import torch
4-
from transformers import AutoModelForCausalLM, AutoTokenizer
5-
63
import mellea.stdlib.functional as mfuncs
74
from mellea.backends.adapters.adapter import AdapterType, IntrinsicAdapter
85
from mellea.backends.huggingface import LocalHFBackend
@@ -12,14 +9,7 @@
129
# This is an example for how you would directly use intrinsics. See `mellea/stdlib/intrinsics/rag.py`
1310
# for helper functions.
1411

15-
# Force CPU usage by creating custom config
16-
model_id = "ibm-granite/granite-3.3-8b-instruct"
17-
device = torch.device("cpu")
18-
tokenizer = AutoTokenizer.from_pretrained(model_id)
19-
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="cpu")
20-
21-
custom_config = (tokenizer, model, device)
22-
backend = LocalHFBackend(model_id=model_id, custom_config=custom_config)
12+
backend = LocalHFBackend(model_id="ibm-granite/granite-3.3-8b-instruct")
2313

2414
# Create the Adapter. IntrinsicAdapter's default to ALORAs.
2515
req_adapter = IntrinsicAdapter(

0 commit comments

Comments
 (0)