Spaces:
Build error
Build error
Commit
·
027ed4c
1
Parent(s):
4797320
convert build_space function to static as cls parameter appears in the gradio textbox title
Browse files
app.py
CHANGED
|
@@ -94,8 +94,8 @@ class SpaceBuilder:
|
|
| 94 |
else:
|
| 95 |
return True
|
| 96 |
|
| 97 |
-
@
|
| 98 |
-
def build_space(
|
| 99 |
"""
|
| 100 |
Creates a space with given inputs
|
| 101 |
:param spaces:
|
|
@@ -106,10 +106,10 @@ class SpaceBuilder:
|
|
| 106 |
"""
|
| 107 |
if spaces == "" or hf_token == "" or space_name == "" or space_description == "":
|
| 108 |
return "Please fill all the inputs"
|
| 109 |
-
if
|
| 110 |
return "The space name is available"
|
| 111 |
else:
|
| 112 |
-
return
|
| 113 |
|
| 114 |
|
| 115 |
iface = gr.Interface(
|
|
|
|
| 94 |
else:
|
| 95 |
return True
|
| 96 |
|
| 97 |
+
@staticmethod
|
| 98 |
+
def build_space(spaces: str, hf_token: str, space_name: str, space_description: str) -> str:
|
| 99 |
"""
|
| 100 |
Creates a space with given inputs
|
| 101 |
:param spaces:
|
|
|
|
| 106 |
"""
|
| 107 |
if spaces == "" or hf_token == "" or space_name == "" or space_description == "":
|
| 108 |
return "Please fill all the inputs"
|
| 109 |
+
if SpaceBuilder.check_space_name_availability(hf_token, space_name):
|
| 110 |
return "The space name is available"
|
| 111 |
else:
|
| 112 |
+
return SpaceBuilder.error_message
|
| 113 |
|
| 114 |
|
| 115 |
iface = gr.Interface(
|