Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,19 +12,19 @@ hand = Hand()
|
|
| 12 |
|
| 13 |
# 3. Directly call the model logic in the Gradio function
|
| 14 |
def generate_handwriting_interface(text: str, style: int) -> str:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
data = InputData(
|
| 16 |
text=text,
|
| 17 |
style=style,
|
| 18 |
bias=0.75,
|
| 19 |
-
stroke_colors=
|
| 20 |
-
stroke_widths=
|
| 21 |
)
|
| 22 |
|
| 23 |
# Validate the input
|
| 24 |
-
try:
|
| 25 |
-
validate_input(data)
|
| 26 |
-
except ValueError as e:
|
| 27 |
-
return f"Error: {str(e)}"
|
| 28 |
|
| 29 |
# Generate the handwriting
|
| 30 |
lines = data.text.split('\n')
|
|
|
|
| 12 |
|
| 13 |
# 3. Directly call the model logic in the Gradio function
|
| 14 |
def generate_handwriting_interface(text: str, style: int) -> str:
|
| 15 |
+
lines = text.split('\n')
|
| 16 |
+
stroke_colors = ["#000000"] * len(lines)
|
| 17 |
+
stroke_widths = [2] * len(lines)
|
| 18 |
+
|
| 19 |
data = InputData(
|
| 20 |
text=text,
|
| 21 |
style=style,
|
| 22 |
bias=0.75,
|
| 23 |
+
stroke_colors=stroke_colors,
|
| 24 |
+
stroke_widths=stroke_widths
|
| 25 |
)
|
| 26 |
|
| 27 |
# Validate the input
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
# Generate the handwriting
|
| 30 |
lines = data.text.split('\n')
|