newtechdevng commited on
Commit
f796207
·
verified ·
1 Parent(s): 3f4e92a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -7,8 +7,9 @@ MODEL_ID = "newtechdevng/qwen-math-tutor"
7
  tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
8
  model = AutoModelForCausalLM.from_pretrained(
9
  MODEL_ID,
10
- torch_dtype = torch.float32,
11
- device_map = "cpu"
 
12
  )
13
  print("Model loaded!")
14
 
@@ -39,7 +40,7 @@ def solve(question, history):
39
  skip_special_tokens=True
40
  )
41
 
42
- with gr.Blocks(theme=gr.themes.Soft(), title="Math Tutor AI") as demo:
43
  gr.Markdown("""
44
  # 🧮 Math Tutor AI
45
  ### Powered by Qwen2.5-Math — Fine-tuned for NCERT & competitive math
@@ -73,4 +74,4 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Math Tutor AI") as demo:
73
  submit.click(respond, [question, chatbot], [question, chatbot])
74
  question.submit(respond, [question, chatbot], [question, chatbot])
75
 
76
- demo.launch()
 
7
  tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
8
  model = AutoModelForCausalLM.from_pretrained(
9
  MODEL_ID,
10
+ torch_dtype = torch.float32,
11
+ device_map = "cpu",
12
+ quantization_config = None,
13
  )
14
  print("Model loaded!")
15
 
 
40
  skip_special_tokens=True
41
  )
42
 
43
+ with gr.Blocks(title="Math Tutor AI") as demo: # ← theme removed from here
44
  gr.Markdown("""
45
  # 🧮 Math Tutor AI
46
  ### Powered by Qwen2.5-Math — Fine-tuned for NCERT & competitive math
 
74
  submit.click(respond, [question, chatbot], [question, chatbot])
75
  question.submit(respond, [question, chatbot], [question, chatbot])
76
 
77
+ demo.launch(theme=gr.themes.Soft()) # ← theme moved to launch()