Skip to content

Use the api_name when calling an app like a function #2523

@freddyaboulton

Description

@freddyaboulton
  • I have searched to see if a similar issue already exists.

Properly using a space like an api requires knowing the fn_index. If you're a downstream consumer of an app, you may not know the fn_index and the fn_index can change if the upstream app is refactored.

Describe the solution you'd like
Would be nice to be able to do something like

demo = gr.Blocks.load("path-to-demo")
output = demo(input, api_name="prediction-route")

Where "prediction-route" is the api_name given to the event in the upstream space.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions