omerXfaruq commited on
Commit
027ed4c
1 Parent(s): 4797320

convert build_space function to static as cls parameter appears in the gradio textbox title

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -94,8 +94,8 @@ class SpaceBuilder:
94
  else:
95
  return True
96
 
97
- @classmethod
98
- def build_space(cls, spaces: str, hf_token: str, space_name: str, space_description: str) -> str:
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 cls.check_space_name_availability(hf_token, space_name):
110
  return "The space name is available"
111
  else:
112
- return cls.error_message
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(