EPark25 commited on
Commit
51c2f76
·
1 Parent(s): 450cdb5
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -3,20 +3,17 @@ from peft import PeftModel
3
  from transformers import TextStreamer
4
 
5
  # Load model directly
6
- from transformers import AutoModel, AutoTokenizer
7
 
8
  """
9
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
10
  Info of how to use a model after training on hf https://huggingface.co/docs/trl/main/en/use_model
11
  """
12
 
13
- model_name_or_path = "unsloth/Llama-3.2-3B-Instruct"
14
- adapter_name = "samlama111/lora_model"
15
 
16
- model = AutoModel.from_pretrained(model_name_or_path)
17
- tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
18
-
19
- model = PeftModel.from_pretrained(model, adapter_name)
20
 
21
 
22
  def respond(
 
3
  from transformers import TextStreamer
4
 
5
  # Load model directly
6
+ from transformers import AutoModelForCausalLM, AutoTokenizer
7
 
8
  """
9
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
10
  Info of how to use a model after training on hf https://huggingface.co/docs/trl/main/en/use_model
11
  """
12
 
13
+ peft_model_id = "samlama111/lora_model"
14
+ model = AutoModelForCausalLM.from_pretrained(peft_model_id)
15
 
16
+ tokenizer = AutoTokenizer.from_pretrained("samlama111/lora_model")
 
 
 
17
 
18
 
19
  def respond(