Spaces:
Paused
Paused
try multiprocessing
Browse files
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 |
-
|
|
|
|
|
|
|
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 π₯
|