Update app.py
Browse files
app.py
CHANGED
|
@@ -39,8 +39,7 @@ print("Loading model...")
|
|
| 39 |
pipe = pipeline(
|
| 40 |
"text-generation",
|
| 41 |
# model="Qwen/Qwen2.5-0.5B-Instruct",
|
| 42 |
-
|
| 43 |
-
model = "google/gemma-2-2b-it",
|
| 44 |
device="cpu",
|
| 45 |
torch_dtype="auto"
|
| 46 |
)
|
|
@@ -219,15 +218,11 @@ def generate_response(user_prompt):
|
|
| 219 |
4. TONE: Be concise, highly professional, and helpful.
|
| 220 |
"""
|
| 221 |
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
# Format for google/gemma-2-2b-it
|
| 229 |
-
combined_prompt = f"{system_prompt}\n\nUser Question:\n{user_prompt}"
|
| 230 |
-
messages = [{"role": "user", "content": combined_prompt}]
|
| 231 |
|
| 232 |
prompt = pipe.tokenizer.apply_chat_template(
|
| 233 |
messages,
|
|
|
|
| 39 |
pipe = pipeline(
|
| 40 |
"text-generation",
|
| 41 |
# model="Qwen/Qwen2.5-0.5B-Instruct",
|
| 42 |
+
model="Qwen/Qwen2.5-1.5B-Instruct",
|
|
|
|
| 43 |
device="cpu",
|
| 44 |
torch_dtype="auto"
|
| 45 |
)
|
|
|
|
| 218 |
4. TONE: Be concise, highly professional, and helpful.
|
| 219 |
"""
|
| 220 |
|
| 221 |
+
messages = [
|
| 222 |
+
{"role": "system", "content": system_prompt},
|
| 223 |
+
{"role": "user", "content": user_prompt}
|
| 224 |
+
]
|
| 225 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
|
| 227 |
prompt = pipe.tokenizer.apply_chat_template(
|
| 228 |
messages,
|