Update app.py
Browse files
app.py
CHANGED
|
@@ -287,7 +287,7 @@ def predict(message, history):
|
|
| 287 |
attention_mask = torch.cat([attention_mask, torch.ones((attention_mask.size(0), 1), device=device, dtype=attention_mask.dtype)], dim=1)
|
| 288 |
generated_text += token_str
|
| 289 |
yield generated_text
|
| 290 |
-
|
| 291 |
def log_feedback(data: gr.LikeData, history: list):
|
| 292 |
global LIKE_COUNTER
|
| 293 |
if not HF_TOKEN:
|
|
@@ -455,7 +455,7 @@ def run_tuning_task():
|
|
| 455 |
# -------------------------------
|
| 456 |
# 7) UI Functions & Gradio Interface
|
| 457 |
# -------------------------------
|
| 458 |
-
|
| 459 |
def check_training_status():
|
| 460 |
global TRAINING_STATUS
|
| 461 |
if TRAINING_STATUS:
|
|
@@ -463,7 +463,7 @@ def check_training_status():
|
|
| 463 |
else:
|
| 464 |
return gr.update(value="", visible=False)
|
| 465 |
|
| 466 |
-
|
| 467 |
def poll_status_updater():
|
| 468 |
while True:
|
| 469 |
yield check_training_status()
|
|
|
|
| 287 |
attention_mask = torch.cat([attention_mask, torch.ones((attention_mask.size(0), 1), device=device, dtype=attention_mask.dtype)], dim=1)
|
| 288 |
generated_text += token_str
|
| 289 |
yield generated_text
|
| 290 |
+
|
| 291 |
def log_feedback(data: gr.LikeData, history: list):
|
| 292 |
global LIKE_COUNTER
|
| 293 |
if not HF_TOKEN:
|
|
|
|
| 455 |
# -------------------------------
|
| 456 |
# 7) UI Functions & Gradio Interface
|
| 457 |
# -------------------------------
|
| 458 |
+
|
| 459 |
def check_training_status():
|
| 460 |
global TRAINING_STATUS
|
| 461 |
if TRAINING_STATUS:
|
|
|
|
| 463 |
else:
|
| 464 |
return gr.update(value="", visible=False)
|
| 465 |
|
| 466 |
+
|
| 467 |
def poll_status_updater():
|
| 468 |
while True:
|
| 469 |
yield check_training_status()
|