Spaces:
Sleeping
Sleeping
EL GHAFRAOUI AYOUB
commited on
Commit
Β·
3b0cd66
1
Parent(s):
3a5be9b
C'
Browse files- app/main.py +6 -2
- re.md +0 -22
app/main.py
CHANGED
@@ -266,12 +266,16 @@ Additional Requirements: {request.additional_requirements}"""
|
|
266 |
if chunk["type"] == "content":
|
267 |
response_content = chunk["content"]
|
268 |
sections = parse_plan_sections(response_content)
|
269 |
-
yield
|
|
|
|
|
|
|
|
|
270 |
'type': 'complete',
|
271 |
'project_title': request.project_title,
|
272 |
'sections': sections,
|
273 |
'raw_content': response_content
|
274 |
-
})}\n\n"
|
275 |
elif chunk["type"] == "error":
|
276 |
yield f"data: {json.dumps({
|
277 |
'type': 'error',
|
|
|
266 |
if chunk["type"] == "content":
|
267 |
response_content = chunk["content"]
|
268 |
sections = parse_plan_sections(response_content)
|
269 |
+
# The `yield` keyword in Python is used in generator functions to return a value
|
270 |
+
# to the caller and temporarily suspend the function's execution. In the context
|
271 |
+
# of asynchronous programming, `yield` is used to create asynchronous generators
|
272 |
+
# that can produce values asynchronously.
|
273 |
+
yield f"""data: {json.dumps({
|
274 |
'type': 'complete',
|
275 |
'project_title': request.project_title,
|
276 |
'sections': sections,
|
277 |
'raw_content': response_content
|
278 |
+
})}\n\n"""
|
279 |
elif chunk["type"] == "error":
|
280 |
yield f"data: {json.dumps({
|
281 |
'type': 'error',
|
re.md
CHANGED
@@ -3,25 +3,3 @@
|
|
3 |
## Project Structure
|
4 |
```
|
5 |
flan-t5-testing/
|
6 |
-
βββ backend/
|
7 |
-
β βββ app/
|
8 |
-
β β βββ main.py # FastAPI application entry point
|
9 |
-
β β βββ controllers/
|
10 |
-
β β β βββ scraper_controller.py
|
11 |
-
β β βββ services/
|
12 |
-
β β β βββ scraper_service.py
|
13 |
-
β β β βββ flan_t5_service.py
|
14 |
-
β β βββ models/
|
15 |
-
β β βββ scrape_log.py
|
16 |
-
β βββ utils/
|
17 |
-
β β βββ text_extractor.py
|
18 |
-
β β βββ html_cleaner.py
|
19 |
-
β βββ requirements.txt
|
20 |
-
βββ frontend/
|
21 |
-
βββ src/
|
22 |
-
β βββ components/
|
23 |
-
β β βββ ScrapingForm.jsx
|
24 |
-
β β βββ ResultDisplay.jsx
|
25 |
-
β βββ App.jsx
|
26 |
-
β βββ main.jsx
|
27 |
-
βββ package.json
|
|
|
3 |
## Project Structure
|
4 |
```
|
5 |
flan-t5-testing/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|