Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
a50b0f8
1
Parent(s):
c231665
update model movement
Browse files
app.py
CHANGED
|
@@ -47,11 +47,7 @@ def generate_embeddings(prompts_text):
|
|
| 47 |
# Load model if not already loaded
|
| 48 |
pipe = load_model()
|
| 49 |
|
| 50 |
-
#
|
| 51 |
-
if torch.cuda.is_available():
|
| 52 |
-
device = torch.device("cuda")
|
| 53 |
-
if hasattr(pipe, 'text_encoder') and pipe.text_encoder is not None:
|
| 54 |
-
pipe.text_encoder = pipe.text_encoder.to(device)
|
| 55 |
|
| 56 |
# Parse prompts (one per line)
|
| 57 |
prompts = [p.strip() for p in prompts_text.strip().split('\n') if p.strip()]
|
|
|
|
| 47 |
# Load model if not already loaded
|
| 48 |
pipe = load_model()
|
| 49 |
|
| 50 |
+
# Note: 8-bit models are already on the correct device, no need to move them
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
# Parse prompts (one per line)
|
| 53 |
prompts = [p.strip() for p in prompts_text.strip().split('\n') if p.strip()]
|