Spaces:
Sleeping
Sleeping
Upload 6 files
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import importlib
|
|
|
|
| 2 |
|
| 3 |
_module = importlib.import_module('app_claude_41')
|
| 4 |
|
|
@@ -17,4 +18,12 @@ if demo is None:
|
|
| 17 |
demo = getattr(_module, factory_name)()
|
| 18 |
break
|
| 19 |
|
| 20 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import importlib
|
| 2 |
+
import gradio as gr
|
| 3 |
|
| 4 |
_module = importlib.import_module('app_claude_41')
|
| 5 |
|
|
|
|
| 18 |
demo = getattr(_module, factory_name)()
|
| 19 |
break
|
| 20 |
|
| 21 |
+
# Ultimate fallback to avoid uninitialized app in Spaces
|
| 22 |
+
if demo is None:
|
| 23 |
+
def _fallback_echo(text: str) -> str:
|
| 24 |
+
return f"Fallback active. Received: {text}"
|
| 25 |
+
|
| 26 |
+
demo = gr.Interface(fn=_fallback_echo, inputs=gr.Textbox(label='Input'), outputs=gr.Textbox(label='Output'), title='Fallback Demo')
|
| 27 |
+
|
| 28 |
+
if __name__ == '__main__':
|
| 29 |
+
demo.launch()
|