broadfield-dev commited on
Commit
cd2ceea
·
verified ·
1 Parent(s): 7b0497c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -107,13 +107,19 @@ def create_hf_space():
107
  # content += line + "\n"
108
  # Write content to a temporary file
109
  with open(f"temp_{filename}", "w") as f:
 
110
  if filename.endswith(".py"):
111
  # Inject parameters into Python files if present
112
  #content = f"PARAMS = {json.dumps(params)}\n\n{content}"
113
- content = list(content.split("\n"))
114
- for line in content:
 
 
 
 
115
  f.write(line + "\n")
116
  f.close()
 
117
  #if filename.endswith(".py"):
118
  # os.system(f"black temp_{filename}")
119
  # Upload to the new Space
 
107
  # content += line + "\n"
108
  # Write content to a temporary file
109
  with open(f"temp_{filename}", "w") as f:
110
+ '''content=""
111
  if filename.endswith(".py"):
112
  # Inject parameters into Python files if present
113
  #content = f"PARAMS = {json.dumps(params)}\n\n{content}"
114
+ content_box = list(content.split("\n"))
115
+ for line in content_box:
116
+ f.write(line + "\n")
117
+ else:'''
118
+ content_box = list(content.split("\n"))
119
+ for line in content_box:
120
  f.write(line + "\n")
121
  f.close()
122
+
123
  #if filename.endswith(".py"):
124
  # os.system(f"black temp_{filename}")
125
  # Upload to the new Space