unknown commited on
Commit
c06d1d5
·
1 Parent(s): 75b5b24
Files changed (1) hide show
  1. app.py +36 -0
app.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # app.py in PUBLIC space
2
+ import gradio as gr
3
+ import os
4
+ hf_token = os.getenv("hf_token")
5
+ # Load the private space
6
+ demo = gr.load(
7
+ name="spaces/Mapraw/UnHealthyChick", # Your private space name
8
+ src="spaces",
9
+ token=hf_token, # Add the token here
10
+ title="Public Demo",
11
+ description="This is a public interface to our private model"
12
+ )
13
+
14
+ # Optional: Add public wrapper functions
15
+ def public_interface(input_text):
16
+ # You can add preprocessing/postprocessing here
17
+ result = demo(input_text)
18
+ return result
19
+
20
+ # Create public interface with additional features
21
+ with gr.Blocks() as demo:
22
+ gr.Markdown("# Public Demo Interface")
23
+ gr.Markdown("This demo interfaces with a private backend")
24
+
25
+ with gr.Row():
26
+ input_box = gr.Textbox(label="Input")
27
+ output_box = gr.Textbox(label="Output")
28
+
29
+ submit_btn = gr.Button("Submit")
30
+ submit_btn.click(
31
+ fn=public_interface,
32
+ inputs=input_box,
33
+ outputs=output_box
34
+ )
35
+
36
+ demo.launch()