Tufan1 commited on
Commit
55b99fb
·
verified ·
1 Parent(s): 58a2772

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -11,7 +11,7 @@ from audio_recorder_streamlit import audio_recorder # Add at the top with other
11
  # Load model and tokenizer from local fine-tuned directory
12
  # Define base and adapter model paths
13
  BASE_MODEL = "stanford-crfm/BioMedLM" # or the path you used originally
14
- ADAPTER_PATH = "Tufan1/BioMedLM-Cardio-Fold10-CPU"
15
  tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
16
 
17
  # Load base model with safe settings
@@ -22,12 +22,12 @@ base_model = AutoModelForCausalLM.from_pretrained(
22
  device_map="cpu" # Force CPU loading
23
  )
24
 
25
- # Load PEFT adapter with proper weight mapping
26
  model = PeftModel.from_pretrained(
27
  base_model,
28
- ADAPTER_PATH,
29
  device_map="cpu",
30
- is_trainable=False
31
  )
32
 
33
  # Explicitly load adapter weights to CPU
 
11
  # Load model and tokenizer from local fine-tuned directory
12
  # Define base and adapter model paths
13
  BASE_MODEL = "stanford-crfm/BioMedLM" # or the path you used originally
14
+ ADAPTER_ID = "Tufan1/BioMedLM-Cardio-Fold10-CPU" # HF model ID
15
  tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
16
 
17
  # Load base model with safe settings
 
22
  device_map="cpu" # Force CPU loading
23
  )
24
 
25
+ # Load adapter directly from Hub
26
  model = PeftModel.from_pretrained(
27
  base_model,
28
+ ADAPTER_ID,
29
  device_map="cpu",
30
+ adapter_name="cardio_adapter"
31
  )
32
 
33
  # Explicitly load adapter weights to CPU