gorkemozkaya's picture
fix global variable
cccae94
raw
history blame
382 Bytes
import gradio as gr
counter = 0
def predict(inp):
global counter
counter += 1
return str(counter)
def run():
demo = gr.Interface(
fn=predict,
inputs=gr.inputs.Textbox(label="Input Text"),
outputs=gr.outputs.Textbox(label="Output Text"),
)
demo.launch(server_name="0.0.0.0", server_port=7860)
if __name__ == "__main__":
run()