Commit ·
f33f0ec
1
Parent(s): 7a8ab20
Restored app-container frame around ChatInterface
Browse files
app.py
CHANGED
|
@@ -95,7 +95,8 @@ def predict(message, history):
|
|
| 95 |
for i, tok_id in enumerate(unique_tokens):
|
| 96 |
t_id = tok_id.item()
|
| 97 |
if t_id not in [bos_id, eos_id, mask_id, pad_id] and counts[i] > 1:
|
| 98 |
-
|
|
|
|
| 99 |
|
| 100 |
if top_k > 0:
|
| 101 |
v, _ = torch.topk(response_logits, top_k)
|
|
@@ -140,9 +141,8 @@ body, .gradio-container {
|
|
| 140 |
|
| 141 |
.hero-container {
|
| 142 |
padding: 2rem 5vw;
|
| 143 |
-
border-bottom:
|
| 144 |
background: #191919;
|
| 145 |
-
margin-bottom: 2rem;
|
| 146 |
}
|
| 147 |
|
| 148 |
.hero-brand {
|
|
@@ -203,7 +203,7 @@ body, .gradio-container {
|
|
| 203 |
}
|
| 204 |
"""
|
| 205 |
|
| 206 |
-
with gr.Blocks(css=custom_css) as demo:
|
| 207 |
with gr.Column(elem_classes="hero-container"):
|
| 208 |
gr.HTML("""
|
| 209 |
<div class="hero-brand">
|
|
|
|
| 95 |
for i, tok_id in enumerate(unique_tokens):
|
| 96 |
t_id = tok_id.item()
|
| 97 |
if t_id not in [bos_id, eos_id, mask_id, pad_id] and counts[i] > 1:
|
| 98 |
+
# Logit subtraction entirely prevents structural duplication loops natively
|
| 99 |
+
response_logits[:, t_id] -= 10.0 * (counts[i].item() - 1)
|
| 100 |
|
| 101 |
if top_k > 0:
|
| 102 |
v, _ = torch.topk(response_logits, top_k)
|
|
|
|
| 141 |
|
| 142 |
.hero-container {
|
| 143 |
padding: 2rem 5vw;
|
| 144 |
+
border-bottom: 2px solid #333;
|
| 145 |
background: #191919;
|
|
|
|
| 146 |
}
|
| 147 |
|
| 148 |
.hero-brand {
|
|
|
|
| 203 |
}
|
| 204 |
"""
|
| 205 |
|
| 206 |
+
with gr.Blocks(css=custom_css, fill_height=True) as demo:
|
| 207 |
with gr.Column(elem_classes="hero-container"):
|
| 208 |
gr.HTML("""
|
| 209 |
<div class="hero-brand">
|