Gijs Wijngaard commited on
Commit
dc6e6db
Β·
1 Parent(s): eaf61fe
Files changed (1) hide show
  1. app.py +3 -1
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