EITD commited on
Commit
0225df5
·
1 Parent(s): b00cfa9
Files changed (2) hide show
  1. app.py +11 -5
  2. requirements.txt +1 -1
app.py CHANGED
@@ -3,12 +3,18 @@ import gradio as gr
3
  """
4
  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
5
  """
6
- # client = InferenceClient("EITD/lora_model", token=os.getenv("HF_TOKEN"))
7
 
8
- model = AutoModelForCausalLM.from_pretrained(
9
- "EITD/orpo_model", # YOUR MODEL YOU USED FOR TRAINING
10
- )
11
- tokenizer = AutoTokenizer.from_pretrained("EITD/orpo_llama")
 
 
 
 
 
 
 
12
 
13
  def respond(
14
  message,
 
3
  """
4
  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
5
  """
 
6
 
7
+ # model = AutoModelForCausalLM.from_pretrained(
8
+ # "EITD/orpo_llama", # YOUR MODEL YOU USED FOR TRAINING
9
+ # )
10
+ # tokenizer = AutoTokenizer.from_pretrained("EITD/orpo_llama")
11
+
12
+ from peft import AutoPeftModelForCausalLM
13
+ model = AutoPeftModelForCausalLM.from_pretrained(
14
+ "orpo_model", # YOUR MODEL YOU USED FOR TRAINING
15
+ load_in_4bit = False,
16
+ )
17
+ tokenizer = AutoTokenizer.from_pretrained("orpo_model")
18
 
19
  def respond(
20
  message,
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
  # huggingface_hub==0.25.2
2
- # peft==0.13.2
3
  transformers==4.46.3
4
  # bitsandbytes==0.42.0
5
  torch==2.5.1
 
1
  # huggingface_hub==0.25.2
2
+ peft==0.13.2
3
  transformers==4.46.3
4
  # bitsandbytes==0.42.0
5
  torch==2.5.1