Spaces:
Runtime error
Runtime error
import gradio as gr | |
import datetime | |
import ssl | |
# SSL μΈμ¦μ κ²μ¦ λ¬Έμ ν΄κ²° | |
ssl._create_default_https_context = ssl._create_unverified_context | |
def update_live_message(): | |
""" | |
νμ¬ μκ°κ³Ό 'live' λ©μμ§λ₯Ό λ°νν©λλ€. | |
""" | |
current_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') | |
return f"{current_time} - live" | |
def run_gradio(): | |
""" | |
μ΅μνμ Gradio μΉ μΈν°νμ΄μ€λ₯Ό μ€μ νκ³ μ€νν©λλ€. | |
""" | |
# λ¨μν ν μ€νΈ μλ΅ μΈν°νμ΄μ€ | |
demo = gr.Blocks(analytics_enabled=False) | |
with demo: | |
live_block = gr.Textbox( | |
label="μν", | |
value=update_live_message(), | |
elem_id="status" | |
) | |
# μ£ΌκΈ°μ μΌλ‘ μλ‘κ³ μΉ¨ν νμ μμ - ν¬μ€μ²΄ν¬λ§ μλ΅ | |
# μλ² μ€ν (SSL κ²μ¦ λΉνμ±ν) | |
demo.launch( | |
server_name="0.0.0.0", | |
server_port=7860, | |
ssl_verify=False | |
) | |
if __name__ == "__main__": | |
run_gradio() |