Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -206,7 +206,7 @@ def get_user_emb(embs, ys):
|
|
| 206 |
|
| 207 |
print('Gathering coefficients')
|
| 208 |
#lin_class = Ridge(fit_intercept=False).fit(feature_embs, chosen_y)
|
| 209 |
-
lin_class = SVC(max_iter=
|
| 210 |
coef_ = torch.tensor(lin_class.coef_, dtype=torch.double).detach().to('cpu')
|
| 211 |
coef_ = coef_ / coef_.abs().max() * 3
|
| 212 |
print('Gathered')
|
|
@@ -468,13 +468,13 @@ Explore the latent space without text prompts based on your preferences. Learn m
|
|
| 468 |
<div style='text-align:center; font-size:14px'>Thanks to @multimodalart for their contributions to the demo, esp. the interface and @maxbittker for feedback.
|
| 469 |
</ div>''')
|
| 470 |
|
| 471 |
-
|
| 472 |
-
scheduler.add_job(func=background_next_image, trigger="interval", seconds=1)
|
| 473 |
-
scheduler.start()
|
| 474 |
log = logging.getLogger('log_here')
|
| 475 |
log.setLevel(logging.ERROR)
|
| 476 |
|
| 477 |
-
|
|
|
|
|
|
|
| 478 |
|
| 479 |
def encode_space(x):
|
| 480 |
im_emb, _ = pipe.encode_image(
|
|
|
|
| 206 |
|
| 207 |
print('Gathering coefficients')
|
| 208 |
#lin_class = Ridge(fit_intercept=False).fit(feature_embs, chosen_y)
|
| 209 |
+
lin_class = SVC(max_iter=500, kernel='linear', C=.1, class_weight='balanced').fit(feature_embs, chosen_y)
|
| 210 |
coef_ = torch.tensor(lin_class.coef_, dtype=torch.double).detach().to('cpu')
|
| 211 |
coef_ = coef_ / coef_.abs().max() * 3
|
| 212 |
print('Gathered')
|
|
|
|
| 468 |
<div style='text-align:center; font-size:14px'>Thanks to @multimodalart for their contributions to the demo, esp. the interface and @maxbittker for feedback.
|
| 469 |
</ div>''')
|
| 470 |
|
| 471 |
+
|
|
|
|
|
|
|
| 472 |
log = logging.getLogger('log_here')
|
| 473 |
log.setLevel(logging.ERROR)
|
| 474 |
|
| 475 |
+
scheduler = BackgroundScheduler()
|
| 476 |
+
scheduler.add_job(func=background_next_image, trigger="interval", seconds=.01)
|
| 477 |
+
scheduler.start()
|
| 478 |
|
| 479 |
def encode_space(x):
|
| 480 |
im_emb, _ = pipe.encode_image(
|