Spaces:
Runtime error
Runtime error
philipp-zettl
commited on
Commit
•
46773aa
1
Parent(s):
49b8bf0
Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,7 @@ from svglib.svglib import svg2rlg
|
|
10 |
from reportlab.graphics import renderPM
|
11 |
from PIL import Image
|
12 |
import os
|
|
|
13 |
|
14 |
|
15 |
vocab_size=33
|
@@ -46,7 +47,7 @@ def generate(prompt):
|
|
46 |
except Exception as e:
|
47 |
if 'illegal san' in str(e):
|
48 |
return pgn, invalid_move_plot
|
49 |
-
filename = f'./moves-{
|
50 |
with open(filename + '.svg', 'w') as f:
|
51 |
f.write(img)
|
52 |
drawing = svg2rlg(filename + '.svg')
|
|
|
10 |
from reportlab.graphics import renderPM
|
11 |
from PIL import Image
|
12 |
import os
|
13 |
+
from uuid import uuid4
|
14 |
|
15 |
|
16 |
vocab_size=33
|
|
|
47 |
except Exception as e:
|
48 |
if 'illegal san' in str(e):
|
49 |
return pgn, invalid_move_plot
|
50 |
+
filename = f'./moves-{str(uuid4())}'
|
51 |
with open(filename + '.svg', 'w') as f:
|
52 |
f.write(img)
|
53 |
drawing = svg2rlg(filename + '.svg')
|