Update routes/dem_pyc_hoan_thanh.py
Browse files
routes/dem_pyc_hoan_thanh.py
CHANGED
|
@@ -1,16 +1,19 @@
|
|
| 1 |
-
from fastapi import
|
| 2 |
from huggingface_hub import list_repo_files
|
| 3 |
from collections import defaultdict
|
| 4 |
import os
|
| 5 |
|
|
|
|
|
|
|
| 6 |
REPO_ID = "doluong6/Quatest1"
|
| 7 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 8 |
|
| 9 |
-
@
|
| 10 |
async def dem_pyc_hoan_thanh():
|
| 11 |
try:
|
| 12 |
all_files = list_repo_files(repo_id=REPO_ID, repo_type="dataset", token=HF_TOKEN)
|
| 13 |
|
|
|
|
| 14 |
scan_files = [
|
| 15 |
f for f in all_files
|
| 16 |
if f.startswith("Khach_hang/") and "/Scan/" in f
|
|
|
|
| 1 |
+
from fastapi import APIRouter
|
| 2 |
from huggingface_hub import list_repo_files
|
| 3 |
from collections import defaultdict
|
| 4 |
import os
|
| 5 |
|
| 6 |
+
router = APIRouter()
|
| 7 |
+
|
| 8 |
REPO_ID = "doluong6/Quatest1"
|
| 9 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 10 |
|
| 11 |
+
@router.get("/dem_pyc_hoan_thanh")
|
| 12 |
async def dem_pyc_hoan_thanh():
|
| 13 |
try:
|
| 14 |
all_files = list_repo_files(repo_id=REPO_ID, repo_type="dataset", token=HF_TOKEN)
|
| 15 |
|
| 16 |
+
# Tìm tất cả file trong thư mục Scan
|
| 17 |
scan_files = [
|
| 18 |
f for f in all_files
|
| 19 |
if f.startswith("Khach_hang/") and "/Scan/" in f
|