Geek7 commited on
Commit
a4aa007
1 Parent(s): 13a252c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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",api_name='predict')
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)