Gijs Wijngaard
commited on
Commit
Β·
dc6e6db
1
Parent(s):
eaf61fe
init
Browse files
app.py
CHANGED
|
@@ -17,10 +17,12 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 17 |
MODEL_ID,
|
| 18 |
device_map="cuda" if torch.cuda.is_available() else "cpu",
|
| 19 |
torch_dtype="auto",
|
| 20 |
-
trust_remote_code=True,
|
| 21 |
_attn_implementation="flash_attention_2",
|
| 22 |
)
|
| 23 |
|
|
|
|
|
|
|
|
|
|
| 24 |
generation_config = GenerationConfig.from_pretrained(MODEL_ID)
|
| 25 |
|
| 26 |
@spaces.GPU
|
|
|
|
| 17 |
MODEL_ID,
|
| 18 |
device_map="cuda" if torch.cuda.is_available() else "cpu",
|
| 19 |
torch_dtype="auto",
|
|
|
|
| 20 |
_attn_implementation="flash_attention_2",
|
| 21 |
)
|
| 22 |
|
| 23 |
+
model.load_adapter(MODEL_ID, adapter_name="speech", device_map="cuda" if torch.cuda.is_available() else "cpu", adapter_kwargs={"subfolder": 'speech-lora'})
|
| 24 |
+
model.set_adapter("speech")
|
| 25 |
+
|
| 26 |
generation_config = GenerationConfig.from_pretrained(MODEL_ID)
|
| 27 |
|
| 28 |
@spaces.GPU
|