Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,9 +24,19 @@ def process_dataset_ui(
|
|
| 24 |
Returns:
|
| 25 |
Status message
|
| 26 |
"""
|
|
|
|
|
|
|
| 27 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
# Set HuggingFace token
|
| 29 |
os.environ["HF_TOKEN"] = hf_token
|
|
|
|
| 30 |
|
| 31 |
# Validate inputs
|
| 32 |
if not original_dataset or not output_dataset:
|
|
@@ -38,7 +48,10 @@ def process_dataset_ui(
|
|
| 38 |
if model_type not in ["qwen3", "lfm2"]:
|
| 39 |
return "β Error: Model type must be either 'qwen3' or 'lfm2'"
|
| 40 |
|
|
|
|
|
|
|
| 41 |
# Process dataset
|
|
|
|
| 42 |
process_dataset(
|
| 43 |
original_dataset=original_dataset,
|
| 44 |
output_dataset=output_dataset,
|
|
@@ -49,7 +62,11 @@ def process_dataset_ui(
|
|
| 49 |
return f"β
Dataset processed successfully and uploaded to: {output_dataset}"
|
| 50 |
|
| 51 |
except Exception as e:
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
# Create Gradio interface
|
| 55 |
with gr.Blocks(title="VyvoTTS Dataset Tokenizer") as demo:
|
|
|
|
| 24 |
Returns:
|
| 25 |
Status message
|
| 26 |
"""
|
| 27 |
+
import traceback
|
| 28 |
+
|
| 29 |
try:
|
| 30 |
+
print("=== Starting Dataset Processing ===")
|
| 31 |
+
print(f"Original Dataset: {original_dataset}")
|
| 32 |
+
print(f"Output Dataset: {output_dataset}")
|
| 33 |
+
print(f"Model Type: {model_type}")
|
| 34 |
+
print(f"Text Field: {text_field}")
|
| 35 |
+
print(f"Token provided: {bool(hf_token)}")
|
| 36 |
+
|
| 37 |
# Set HuggingFace token
|
| 38 |
os.environ["HF_TOKEN"] = hf_token
|
| 39 |
+
print("β Token set in environment")
|
| 40 |
|
| 41 |
# Validate inputs
|
| 42 |
if not original_dataset or not output_dataset:
|
|
|
|
| 48 |
if model_type not in ["qwen3", "lfm2"]:
|
| 49 |
return "β Error: Model type must be either 'qwen3' or 'lfm2'"
|
| 50 |
|
| 51 |
+
print("β Input validation passed")
|
| 52 |
+
|
| 53 |
# Process dataset
|
| 54 |
+
print("Starting dataset processing...")
|
| 55 |
process_dataset(
|
| 56 |
original_dataset=original_dataset,
|
| 57 |
output_dataset=output_dataset,
|
|
|
|
| 62 |
return f"β
Dataset processed successfully and uploaded to: {output_dataset}"
|
| 63 |
|
| 64 |
except Exception as e:
|
| 65 |
+
error_msg = f"β Error: {str(e)}\n\n"
|
| 66 |
+
error_msg += f"Error Type: {type(e).__name__}\n\n"
|
| 67 |
+
error_msg += f"Traceback:\n{traceback.format_exc()}"
|
| 68 |
+
print(error_msg)
|
| 69 |
+
return error_msg
|
| 70 |
|
| 71 |
# Create Gradio interface
|
| 72 |
with gr.Blocks(title="VyvoTTS Dataset Tokenizer") as demo:
|