Skip to content

Commit

Permalink
polish code
Browse files Browse the repository at this point in the history
  • Loading branch information
cyber-pioneer committed Dec 27, 2024
1 parent 008416d commit 8a1bd3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions flagscale/serve/core/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def build_task(self):
self.check_dag()
return

def run_task(self, input_data):
def run_task(self, input_data=None):
assert len(self.tasks) > 0
ray.init(
num_gpus=6,
Expand Down Expand Up @@ -134,7 +134,10 @@ def run_task(self, input_data):
model_nodes[dependencies[0]]
)
else:
model_nodes[model_alias] = self.tasks[model_alias].bind(input_data)
if input_data is None:
model_nodes[model_alias] = self.tasks[model_alias].bind()
else:
model_nodes[model_alias] = self.tasks[model_alias].bind(input_data)
models_to_process.remove(model_alias)
progress = True
if not progress:
Expand Down
2 changes: 1 addition & 1 deletion flagscale/serve/run_serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def main():
if config["deploy"].get("router"):
builder.run_router_task()
else:
result = builder.run_task(input_data="Introduce Bruce Lee")
result = builder.run_task()

if __name__ == "__main__":
main()

0 comments on commit 8a1bd3e

Please sign in to comment.