fix: embed device=cpu, VL model class, file input reset
Browse files- lm.py +4 -4
- static/_app/index-Bh7aucbQ.js +0 -0
- static/index.html +1 -1
lm.py
CHANGED
|
@@ -292,7 +292,7 @@ if USE_LM_STUDIO:
|
|
| 292 |
|
| 293 |
else:
|
| 294 |
import torch
|
| 295 |
-
from transformers import pipeline, AutoProcessor, AutoModelForCausalLM
|
| 296 |
from sentence_transformers import SentenceTransformer
|
| 297 |
|
| 298 |
_text_pipe = None
|
|
@@ -327,7 +327,7 @@ else:
|
|
| 327 |
global _embed_model_inst
|
| 328 |
if _embed_model_inst is None:
|
| 329 |
print(f"[lm] Loading {EMBED_MODEL}…")
|
| 330 |
-
_embed_model_inst = SentenceTransformer(EMBED_MODEL)
|
| 331 |
print("[lm] Embeddings ready")
|
| 332 |
return _embed_model_inst
|
| 333 |
|
|
@@ -368,8 +368,8 @@ else:
|
|
| 368 |
if _vl_pipe is None:
|
| 369 |
print(f"[lm] Loading VL model {HF_VL_MODEL}…")
|
| 370 |
_processor = AutoProcessor.from_pretrained(HF_VL_MODEL)
|
| 371 |
-
_vl_model_inst =
|
| 372 |
-
HF_VL_MODEL,
|
| 373 |
)
|
| 374 |
_vl_pipe = (_processor, _vl_model_inst)
|
| 375 |
processor, vl_model = _vl_pipe
|
|
|
|
| 292 |
|
| 293 |
else:
|
| 294 |
import torch
|
| 295 |
+
from transformers import pipeline, AutoProcessor, AutoModelForCausalLM, Qwen2_5_VLForConditionalGeneration
|
| 296 |
from sentence_transformers import SentenceTransformer
|
| 297 |
|
| 298 |
_text_pipe = None
|
|
|
|
| 327 |
global _embed_model_inst
|
| 328 |
if _embed_model_inst is None:
|
| 329 |
print(f"[lm] Loading {EMBED_MODEL}…")
|
| 330 |
+
_embed_model_inst = SentenceTransformer(EMBED_MODEL, device="cpu")
|
| 331 |
print("[lm] Embeddings ready")
|
| 332 |
return _embed_model_inst
|
| 333 |
|
|
|
|
| 368 |
if _vl_pipe is None:
|
| 369 |
print(f"[lm] Loading VL model {HF_VL_MODEL}…")
|
| 370 |
_processor = AutoProcessor.from_pretrained(HF_VL_MODEL)
|
| 371 |
+
_vl_model_inst = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 372 |
+
HF_VL_MODEL, dtype=torch.bfloat16,
|
| 373 |
)
|
| 374 |
_vl_pipe = (_processor, _vl_model_inst)
|
| 375 |
processor, vl_model = _vl_pipe
|
static/_app/index-Bh7aucbQ.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
static/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>Mycelium</title>
|
| 8 |
-
<script type="module" crossorigin src="/_app/index-
|
| 9 |
<link rel="stylesheet" crossorigin href="/_app/index-BvUgL4Tz.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
|
|
|
| 5 |
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>Mycelium</title>
|
| 8 |
+
<script type="module" crossorigin src="/_app/index-Bh7aucbQ.js"></script>
|
| 9 |
<link rel="stylesheet" crossorigin href="/_app/index-BvUgL4Tz.css">
|
| 10 |
</head>
|
| 11 |
<body>
|