Zedel17 commited on
Commit
afff010
·
1 Parent(s): 4b66dfa

Small Fix Chat Interface

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -30,7 +30,9 @@ base_model = AutoModelForCausalLM.from_pretrained(
30
 
31
  # Load fine-tuned adapter
32
  model = PeftModel.from_pretrained(base_model, ADAPTER_ID, token=hf_token)
33
- tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, token=hf_token)
 
 
34
  tokenizer.pad_token = tokenizer.eos_token
35
 
36
  print("Model loaded successfully!")
@@ -76,6 +78,7 @@ demo = gr.ChatInterface(
76
  "Can you help me with a coding question?",
77
  "Tell me something interesting",
78
  ],
 
79
  )
80
 
81
  if __name__ == "__main__":
 
30
 
31
  # Load fine-tuned adapter
32
  model = PeftModel.from_pretrained(base_model, ADAPTER_ID, token=hf_token)
33
+
34
+ # Load tokenizer from Instruct version (has chat template)
35
+ tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-1B-Instruct", token=hf_token)
36
  tokenizer.pad_token = tokenizer.eos_token
37
 
38
  print("Model loaded successfully!")
 
78
  "Can you help me with a coding question?",
79
  "Tell me something interesting",
80
  ],
81
+ cache_examples=False, # Disable caching to avoid startup issues
82
  )
83
 
84
  if __name__ == "__main__":