ZennyKenny commited on
Commit
15c23cd
·
verified ·
1 Parent(s): f60da4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -4,13 +4,12 @@ import spaces
4
  import gradio as gr
5
  from peft import PeftModel
6
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
7
- import torch
8
  import threading
9
 
10
- # Load the base model
11
  base_model = AutoModelForCausalLM.from_pretrained(
12
  "unsloth/qwen2.5-3b-instruct-unsloth-bnb-4bit",
13
- device_map="auto",
14
  torch_dtype="auto"
15
  )
16
 
@@ -57,4 +56,4 @@ demo = gr.Interface(
57
  allow_flagging="never"
58
  )
59
 
60
- demo.launch(share=True)
 
4
  import gradio as gr
5
  from peft import PeftModel
6
  from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
 
7
  import threading
8
 
9
+ # Load the base model without quantization to avoid bitsandbytes issues
10
  base_model = AutoModelForCausalLM.from_pretrained(
11
  "unsloth/qwen2.5-3b-instruct-unsloth-bnb-4bit",
12
+ device_map="cpu", # Force CPU to avoid bitsandbytes dependency
13
  torch_dtype="auto"
14
  )
15
 
 
56
  allow_flagging="never"
57
  )
58
 
59
+ demo.launch(share=True)