Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,6 +22,14 @@ import asyncio
|
|
| 22 |
import tempfile
|
| 23 |
import shutil
|
| 24 |
from huggingface_hub import HfApi, HfFolder, Repository
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
async def async_upload_model(local_dir, hf_repo, output_log):
|
| 27 |
try:
|
|
@@ -174,8 +182,9 @@ You are a wise teacher interpreting Bhagavad Gita with deep insights.
|
|
| 174 |
tokenizer.save_pretrained(output_dir)
|
| 175 |
|
| 176 |
# ==== Async upload ====
|
|
|
|
| 177 |
hf_repo = "rahul7star/Qwen0.5-3B-Gita"
|
| 178 |
-
|
| 179 |
|
| 180 |
progress(1.0, desc="Complete!")
|
| 181 |
|
|
|
|
| 22 |
import tempfile
|
| 23 |
import shutil
|
| 24 |
from huggingface_hub import HfApi, HfFolder, Repository
|
| 25 |
+
import threading
|
| 26 |
+
|
| 27 |
+
# ==== Async upload wrapper ====
|
| 28 |
+
def start_async_upload(local_dir, hf_repo, output_log):
|
| 29 |
+
def runner():
|
| 30 |
+
asyncio.run(async_upload_model(local_dir, hf_repo, output_log))
|
| 31 |
+
threading.Thread(target=runner, daemon=True).start()
|
| 32 |
+
|
| 33 |
|
| 34 |
async def async_upload_model(local_dir, hf_repo, output_log):
|
| 35 |
try:
|
|
|
|
| 182 |
tokenizer.save_pretrained(output_dir)
|
| 183 |
|
| 184 |
# ==== Async upload ====
|
| 185 |
+
# ==== Async upload ====
|
| 186 |
hf_repo = "rahul7star/Qwen0.5-3B-Gita"
|
| 187 |
+
start_async_upload(output_dir, hf_repo, output_log)
|
| 188 |
|
| 189 |
progress(1.0, desc="Complete!")
|
| 190 |
|