File size: 586 Bytes
8f1d0f8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import g4f
import g4f.api
import gradio as gr

# Your existing g4f server code
if __name__ == "__main__":
    print(f'Starting server... [g4f v-{g4f.version}]')
    g4f.api.Api(engine=g4f, debug=True).run(ip="127.0.0.1:1337")

# Gradio Interface
iface = gr.Interface(
    fn=None,  # You should replace None with your function that interacts with the g4f engine
    live=True,
    capture_session=True,
    inputs=[gr.Textbox("Input text", default="")],
    outputs="text",
    title="g4f Gradio Interface",
    description="Interact with g4f engine through Gradio.",
)

iface.launch()