Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
def saludo(nombre: str) -> str:
|
|
@@ -10,8 +11,11 @@ with gr.Blocks() as demo:
|
|
| 10 |
boton = gr.Button("Saludar")
|
| 11 |
boton.click(fn=saludo, inputs=nombre, outputs=salida)
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
#import os
|
|
|
|
| 1 |
+
import os
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
def saludo(nombre: str) -> str:
|
|
|
|
| 11 |
boton = gr.Button("Saludar")
|
| 12 |
boton.click(fn=saludo, inputs=nombre, outputs=salida)
|
| 13 |
|
| 14 |
+
# Hugging Face Spaces espera puerto 8080, accesible en 0.0.0.0
|
| 15 |
+
if __name__ == "__main__":
|
| 16 |
+
port = int(os.environ.get("PORT", 7860)) # PORT lo pone el runtime si existe
|
| 17 |
+
demo.launch(server_name="0.0.0.0", server_port=port, show_api=True)
|
| 18 |
+
|
| 19 |
|
| 20 |
|
| 21 |
#import os
|