Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -146,7 +146,7 @@ def gradient_cuff_reject(message,with_defense, sample_times,perturb_times,thresh
|
|
146 |
original_embedding,shift_embeddings,prefix_embedding,suffix_embedding
|
147 |
)
|
148 |
with torch.no_grad():
|
149 |
-
responses = engine(input_embeds)
|
150 |
labels=get_labels(responses)
|
151 |
results=[None for _ in range(perturb_times+1)]
|
152 |
results[0]=sum(labels)/len(labels)
|
|
|
146 |
original_embedding,shift_embeddings,prefix_embedding,suffix_embedding
|
147 |
)
|
148 |
with torch.no_grad():
|
149 |
+
responses = engine(input_embeds.to(torch.bfloat16))
|
150 |
labels=get_labels(responses)
|
151 |
results=[None for _ in range(perturb_times+1)]
|
152 |
results[0]=sum(labels)/len(labels)
|