| import subprocess |
| import os |
| import gradio as gr |
|
|
| def start_all(): |
| |
| dns_content = "nameserver 8.8.8.8\nnameserver 1.1.1.1" |
| with open("/tmp/dns/resolv.conf", "w") as f: |
| f.write(dns_content) |
|
|
| |
| |
| ttyd_cmd = [ |
| "ttyd", "-p", "8080", |
| "proot", "-b", "/tmp/dns/resolv.conf:/etc/resolv.conf", |
| "bash" |
| ] |
| subprocess.Popen(ttyd_cmd) |
|
|
| |
| def fake_ai(text): return f"Linguistic Engine Result: {text}" |
| |
| with gr.Blocks(title="AQSO-CORE Research") as demo: |
| gr.Markdown("# 🔬 AQSO-CORE Linguistic Research") |
| gr.Markdown("Environment status: Operational. DNS: Secured.") |
| inp = gr.Textbox(label="Data Input") |
| out = gr.Textbox(label="Analysis") |
| btn = gr.Button("Process") |
| btn.click(fake_ai, inp, out) |
| |
| |
| gr.Markdown(f"### [Internal Access](https://{os.getenv('SPACE_ID').replace('/', '-')}.hf.space/proxy/8080/)") |
|
|
| demo.launch(server_name="0.0.0.0", server_port=7860) |
|
|
| if __name__ == "__main__": |
| start_all() |
| |