Braszczynski commited on
Commit
867f084
·
verified ·
1 Parent(s): 1ffa7d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -9,13 +9,11 @@ model_name = "unsloth/Meta-Llama-3.1-8B-Instruct"
9
  tokenizer = AutoTokenizer.from_pretrained(model_name, load_in_4bit=True)
10
 
11
  # Load the base model with adapters, ensuring it's loaded in 4-bit
12
- model = AutoAdapterModel.from_pretrained(model_name, load_in_4bit=True).to("cpu")
13
 
14
  # Load the adapter
15
  model.load_adapter("Braszczynski/Llama-3.2-3B-Instruct-bnb-4bit-460steps")
16
 
17
- # Free up unused memory
18
- torch.cuda.empty_cache()
19
 
20
  def respond(message, history, system_message, max_tokens, temperature, top_p):
21
  # Combine system message and chat history
 
9
  tokenizer = AutoTokenizer.from_pretrained(model_name, load_in_4bit=True)
10
 
11
  # Load the base model with adapters, ensuring it's loaded in 4-bit
12
+ model = AutoAdapterModel.from_pretrained(model_name, load_in_4bit=True)
13
 
14
  # Load the adapter
15
  model.load_adapter("Braszczynski/Llama-3.2-3B-Instruct-bnb-4bit-460steps")
16
 
 
 
17
 
18
  def respond(message, history, system_message, max_tokens, temperature, top_p):
19
  # Combine system message and chat history