Safetensors
mjbuehler commited on
Commit
6bd5dfc
1 Parent(s): 9db8426

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +8 -19
README.md CHANGED
@@ -98,30 +98,19 @@ model = xlora.from_pretrained(
98
  "cuda",
99
  )
100
  ```
101
- ## Loading pre-trained X-LoRA model
102
 
103
  ```python
104
  import torch
105
- from xlora.xlora_utils import load_model # type: ignore
106
 
107
- XLoRA_model_name = "lamm-mit/x-lora/X-LoRA"
108
 
109
- model, tokenizer = load_model(
110
- model_name="HuggingFaceH4/zephyr-7b-beta",
111
- device="cuda:0",
112
- dtype=torch.bfloat16,
113
- fine_tune_model_name=XLoRA_model_name,
114
- adapters={
115
- "adapter_1": "lamm-mit/x-lora/X-LoRA_adapters/1/",
116
- "adapter_2": "lamm-mit/x-lora/X-LoRA_adapters/2/",
117
- "adapter_3": "lamm-mit/x-lora/X-LoRA_adapters/3/",
118
- "adapter_4": "lamm-mit/x-lora/X-LoRA_adapters/4/",
119
- "adapter_5": "lamm-mit/x-lora/X-LoRA_adapters/5/",
120
- "adapter_6": "lamm-mit/x-lora/X-LoRA_adapters/6/",
121
- "adapter_7": "lamm-mit/x-lora/X-LoRA_adapters/7/",
122
- "adapter_8": "lamm-mit/x-lora/X-LoRA_adapters/8/",
123
- "adapter_9": "lamm-mit/x-lora/X-LoRA_adapters/9/",
124
- },
125
  )
126
  ```
127
  Inference:
 
98
  "cuda",
99
  )
100
  ```
101
+ ## Loading pre-trained X-LoRA model directly from Hugging Face Hub
102
 
103
  ```python
104
  import torch
105
+ from xlora.xlora_utils import load_model
106
 
107
+ XLoRa_model_name = 'lamm-mit/x-lora'
108
 
109
+ model,tokenizer=load_model(model_name = XLoRa_model_name,
110
+ device='cuda:0',
111
+ use_flash_attention_2=True,
112
+ dtype=torch.bfloat16,
113
+ )
 
 
 
 
 
 
 
 
 
 
 
114
  )
115
  ```
116
  Inference: