Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
| 11 |
-
device_map
|
|
|
|
| 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(
|
| 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()
|