EL GHAFRAOUI AYOUB commited on
Commit
3b0cd66
Β·
1 Parent(s): 3a5be9b
Files changed (2) hide show
  1. app/main.py +6 -2
  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 f"data: {json.dumps({
 
 
 
 
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/