Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -39,13 +39,9 @@ def get_sdk_version(sdk_choice: str) -> str:
|
|
39 |
|
40 |
def extract_code(text: str) -> str:
|
41 |
"""
|
42 |
-
Extract the last
|
43 |
-
…
|
44 |
-
block. If none, return whole text.
|
45 |
"""
|
46 |
-
blocks = re.findall(r"
|
47 |
-
(?:\w*\n)?([\s\S]*?)
|
48 |
-
", text)
|
49 |
return blocks[-1].strip() if blocks else text.strip()
|
50 |
|
51 |
# — HF SPACE LOGGING —
|
@@ -253,4 +249,4 @@ with gr.Blocks(title="HF Space Auto‑Builder") as demo:
|
|
253 |
outputs=[build_box, run_box]
|
254 |
)
|
255 |
|
256 |
-
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
39 |
|
40 |
def extract_code(text: str) -> str:
|
41 |
"""
|
42 |
+
Extract the last ```…``` block. If none, return whole text.
|
|
|
|
|
43 |
"""
|
44 |
+
blocks = re.findall(r"```(?:\w*\n)?([\s\S]*?)```", text)
|
|
|
|
|
45 |
return blocks[-1].strip() if blocks else text.strip()
|
46 |
|
47 |
# — HF SPACE LOGGING —
|
|
|
249 |
outputs=[build_box, run_box]
|
250 |
)
|
251 |
|
252 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|