Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,6 @@ def extract_keywords(script):
|
|
38 |
keywords = re.findall(r'\b\w+\b', script.lower())
|
39 |
return list(set(keywords))
|
40 |
|
41 |
-
# Function to create a character animation based on script keywords
|
42 |
def create_character_animation(script):
|
43 |
keywords = extract_keywords(script)
|
44 |
|
@@ -48,7 +47,8 @@ def create_character_animation(script):
|
|
48 |
|
49 |
# Update text with cycling keywords
|
50 |
keyword = keywords[num % len(keywords)]
|
51 |
-
ax.texts
|
|
|
52 |
ax.text2D(0.05, 0.95, keyword, transform=ax.transAxes)
|
53 |
|
54 |
return line,
|
|
|
38 |
keywords = re.findall(r'\b\w+\b', script.lower())
|
39 |
return list(set(keywords))
|
40 |
|
|
|
41 |
def create_character_animation(script):
|
42 |
keywords = extract_keywords(script)
|
43 |
|
|
|
47 |
|
48 |
# Update text with cycling keywords
|
49 |
keyword = keywords[num % len(keywords)]
|
50 |
+
for txt in ax.texts:
|
51 |
+
txt.remove()
|
52 |
ax.text2D(0.05, 0.95, keyword, transform=ax.transAxes)
|
53 |
|
54 |
return line,
|