Update app.py
Browse files
app.py
CHANGED
@@ -50,11 +50,11 @@ async def infer(model_str, prompt, seed=1, timeout=inference_timeout):
|
|
50 |
|
51 |
# Expose Gradio API
|
52 |
def generate_api(model_str, prompt, seed=1):
|
53 |
-
result = asyncio.run(infer(model_str, prompt, seed))
|
54 |
if result:
|
55 |
return result # Path to generated image
|
56 |
return None
|
57 |
|
58 |
# Launch Gradio API without frontend
|
59 |
-
iface = gr.Interface(fn=generate_api, inputs=["text", "text", "number"], outputs="file"
|
60 |
iface.launch(show_api=True, share=True)
|
|
|
50 |
|
51 |
# Expose Gradio API
|
52 |
def generate_api(model_str, prompt, seed=1):
|
53 |
+
result = asyncio.run(infer(model_str, prompt, seed,api_name="/predict" ))
|
54 |
if result:
|
55 |
return result # Path to generated image
|
56 |
return None
|
57 |
|
58 |
# Launch Gradio API without frontend
|
59 |
+
iface = gr.Interface(fn=generate_api, inputs=["text", "text", "number"], outputs="file")
|
60 |
iface.launch(show_api=True, share=True)
|