Spaces:
Sleeping
Sleeping
kltn20133118
commited on
Update main.py
Browse files
main.py
CHANGED
@@ -8,6 +8,17 @@ import json
|
|
8 |
import asyncio
|
9 |
from crawl4ai import AsyncWebCrawler
|
10 |
from crawl4ai.extraction_strategy import JsonCssExtractionStrategy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
# Định nghĩa model request body
|
13 |
class URLProcessRequest(BaseModel):
|
|
|
8 |
import asyncio
|
9 |
from crawl4ai import AsyncWebCrawler
|
10 |
from crawl4ai.extraction_strategy import JsonCssExtractionStrategy
|
11 |
+
import modal
|
12 |
+
|
13 |
+
crawler = modal.Image.debian_slim(python_version="3.10").pip_install_from_requirements("requirements.txt").run_commands(
|
14 |
+
"apt-get update",
|
15 |
+
"apt-get install -y software-properties-common",
|
16 |
+
"apt-add-repository non-free",
|
17 |
+
"apt-add-repository contrib",
|
18 |
+
"playwright install-deps chromium",
|
19 |
+
"playwright install chromium",
|
20 |
+
"playwright install",
|
21 |
+
)
|
22 |
|
23 |
# Định nghĩa model request body
|
24 |
class URLProcessRequest(BaseModel):
|