Spaces:
Sleeping
Sleeping
Update app.py with transformer embeddings and prediction pipeline
Browse files
app.py
CHANGED
@@ -75,10 +75,13 @@ def predict_with_gpflow(model, X):
|
|
75 |
# Get predictions
|
76 |
#predict_fn = model.predict_f_compiled
|
77 |
predict_fn = model.signatures["serving_default"]
|
78 |
-
mean, variance = predict_fn(Xnew=X_tensor)
|
|
|
|
|
79 |
|
80 |
# Return mean and variance as numpy arrays
|
81 |
-
return mean.numpy().flatten(), variance.numpy().flatten()
|
|
|
82 |
|
83 |
|
84 |
|
|
|
75 |
# Get predictions
|
76 |
#predict_fn = model.predict_f_compiled
|
77 |
predict_fn = model.signatures["serving_default"]
|
78 |
+
#mean, variance = predict_fn(Xnew=X_tensor)
|
79 |
+
mean = result["output_0"].numpy() # Adjust output key names if needed
|
80 |
+
variance = result["output_1"].numpy()
|
81 |
|
82 |
# Return mean and variance as numpy arrays
|
83 |
+
#return mean.numpy().flatten(), variance.numpy().flatten()
|
84 |
+
return mean.flatten(), variance.flatten()
|
85 |
|
86 |
|
87 |
|