joaogante HF staff commited on
Commit
7bea5b8
β€’
1 Parent(s): 8bece88

try multiprocessing

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -4,6 +4,7 @@ import torch
4
  import torch.distributed.run as distributed_run
5
  from git import Repo
6
  from huggingface_hub import HfApi
 
7
 
8
 
9
  # Clone the medusa repo locally
@@ -84,7 +85,10 @@ def run(model_id: str) -> str:
84
 
85
  # Run the medusa heads creation
86
  try:
87
- repo_id = create_medusa_heads(model_id=model_id)
 
 
 
88
  print("Success βœ…\nMedusa heads uploaded to: ", repo_id)
89
  return f"""
90
  ### Success πŸ”₯
 
4
  import torch.distributed.run as distributed_run
5
  from git import Repo
6
  from huggingface_hub import HfApi
7
+ import multiprocessing as mp
8
 
9
 
10
  # Clone the medusa repo locally
 
85
 
86
  # Run the medusa heads creation
87
  try:
88
+ proc = mp.Process(target=create_medusa_heads, args=(model_id, ))
89
+ proc.start()
90
+ proc.join()
91
+ repo_id = f"medusa-{model_id}"
92
  print("Success βœ…\nMedusa heads uploaded to: ", repo_id)
93
  return f"""
94
  ### Success πŸ”₯