Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,17 +4,13 @@ from peft import PeftModel
|
|
| 4 |
import torch
|
| 5 |
|
| 6 |
# --- Load tokenizer and model for CPU ---
|
| 7 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
"unsloth/Qwen3-1.7B",
|
| 11 |
dtype=torch.float32,
|
| 12 |
device_map={"": "cpu"},
|
| 13 |
)
|
| 14 |
|
| 15 |
-
model = PeftModel.from_pretrained(base_model, "khazarai/BioGenesis-ToT").to("cpu")
|
| 16 |
-
|
| 17 |
-
|
| 18 |
# --- Chatbot logic ---
|
| 19 |
def generate_response(user_input, chat_history):
|
| 20 |
if not user_input.strip():
|
|
|
|
| 4 |
import torch
|
| 5 |
|
| 6 |
# --- Load tokenizer and model for CPU ---
|
| 7 |
+
tokenizer = AutoTokenizer.from_pretrained("khazarai/BioGenesis-ToT")
|
| 8 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 9 |
+
"khazarai/BioGenesis-ToT",
|
|
|
|
| 10 |
dtype=torch.float32,
|
| 11 |
device_map={"": "cpu"},
|
| 12 |
)
|
| 13 |
|
|
|
|
|
|
|
|
|
|
| 14 |
# --- Chatbot logic ---
|
| 15 |
def generate_response(user_input, chat_history):
|
| 16 |
if not user_input.strip():
|