Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -65,7 +65,6 @@ def save_data(t,m,l,n,w,p):
|
|
65 |
buffer.write(file_out.encode())
|
66 |
buffer.seek(0)
|
67 |
rand = random.randint(1000,9999)
|
68 |
-
"https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/sky.png"
|
69 |
api.upload_file(
|
70 |
path_or_fileobj=buffer,
|
71 |
path_in_repo=f"{title}_{rand}.html",
|
@@ -73,6 +72,13 @@ def save_data(t,m,l,n,w,p):
|
|
73 |
token=token,
|
74 |
repo_type="space",
|
75 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
#return f"https://broadfield-a.hf.space/?pdfurl={t}&mod={m}&len={l}&nos={n}&wid={w}&pau={p}"
|
77 |
return f"<div><a href='https://broadfield-a.static.hf.space/{title}_{rand}.html' target='_blank'>https://broadfield-a.static.hf.space/{title}_{rand}.html</a></div>"
|
78 |
def load_html(url):
|
|
|
65 |
buffer.write(file_out.encode())
|
66 |
buffer.seek(0)
|
67 |
rand = random.randint(1000,9999)
|
|
|
68 |
api.upload_file(
|
69 |
path_or_fileobj=buffer,
|
70 |
path_in_repo=f"{title}_{rand}.html",
|
|
|
72 |
token=token,
|
73 |
repo_type="space",
|
74 |
)
|
75 |
+
api.upload_file(
|
76 |
+
path_or_fileobj=f"/images/{title}.png",
|
77 |
+
path_in_repo=f"/images/{title}.png",
|
78 |
+
repo_id=f'{user_name}/{repo_name}',
|
79 |
+
token=token,
|
80 |
+
repo_type="space",
|
81 |
+
)
|
82 |
#return f"https://broadfield-a.hf.space/?pdfurl={t}&mod={m}&len={l}&nos={n}&wid={w}&pau={p}"
|
83 |
return f"<div><a href='https://broadfield-a.static.hf.space/{title}_{rand}.html' target='_blank'>https://broadfield-a.static.hf.space/{title}_{rand}.html</a></div>"
|
84 |
def load_html(url):
|