pyakhurel commited on
Commit
0208608
1 Parent(s): 0c99222

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -13
app.py CHANGED
@@ -3,26 +3,15 @@ import gradio as gr
3
  from peft import PeftModel
4
  from transformers import AutoModelForCausalLM, AutoTokenizer
5
  import transformers
6
- import bitsandbytes
7
- import accelerate
8
 
9
 
10
  adapters_name = "1littlecoder/mistral-7b-mj-finetuned"
11
  model_name = "bn22/Mistral-7B-Instruct-v0.1-sharded"
12
 
13
- bnb_config = transformers.BitsAndBytesConfig(
14
- load_in_8bit=True,
15
- bnb_4bit_use_double_quant=True,
16
- bnb_4bit_quant_type="nf4",
17
- bnb_4bit_compute_dtype=torch.bfloat16
18
- )
19
 
20
  model = AutoModelForCausalLM.from_pretrained(
21
- model_name,
22
- load_in_8bit=True,
23
- torch_dtype=torch.bfloat16,
24
- quantization_config=bnb_config,
25
- device_map='auto'
26
  )
27
  model = PeftModel.from_pretrained(model, adapters_name)
28
 
 
3
  from peft import PeftModel
4
  from transformers import AutoModelForCausalLM, AutoTokenizer
5
  import transformers
 
 
6
 
7
 
8
  adapters_name = "1littlecoder/mistral-7b-mj-finetuned"
9
  model_name = "bn22/Mistral-7B-Instruct-v0.1-sharded"
10
 
11
+
 
 
 
 
 
12
 
13
  model = AutoModelForCausalLM.from_pretrained(
14
+ model_name
 
 
 
 
15
  )
16
  model = PeftModel.from_pretrained(model, adapters_name)
17