Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,44 @@
|
|
1 |
from flask import Flask, redirect
|
|
|
2 |
|
3 |
app = Flask(__name__)
|
4 |
|
5 |
@app.route('/get_video')
|
6 |
def get_video():
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
if __name__ == '__main__':
|
11 |
app.run(host='0.0.0.0', port=7860)
|
|
|
1 |
from flask import Flask, redirect
|
2 |
+
from video import video_generation
|
3 |
|
4 |
app = Flask(__name__)
|
5 |
|
6 |
@app.route('/get_video')
|
7 |
def get_video():
|
8 |
+
text = """
|
9 |
+
**Photosynthesis** is the biological process by which green plants, algae, and some bacteria convert light energy (usually from the sun) into chemical energy stored in glucose (a type of sugar). This process is fundamental to life on Earth, as it produces oxygen and provides energy for nearly all ecosystems.
|
10 |
+
|
11 |
+
### **Key Steps of Photosynthesis**
|
12 |
+
The overall chemical equation for photosynthesis is:
|
13 |
+
**6CO₂ + 6H₂O + Light Energy → C₆H₁₂O₆ (glucose) + 6O₂**
|
14 |
+
|
15 |
+
#### **1. Light-Dependent Reactions (Occur in Thylakoids of Chloroplasts)**
|
16 |
+
- Chlorophyll (the green pigment in leaves) absorbs sunlight.
|
17 |
+
- Water (H₂O) is split into oxygen (O₂), protons (H⁺), and electrons (e⁻).
|
18 |
+
- Oxygen is released as a byproduct (essential for life!).
|
19 |
+
- Energy from sunlight is stored in **ATP** and **NADPH** (energy carriers).
|
20 |
+
|
21 |
+
#### **2. Calvin Cycle (Light-Independent Reactions, Occurs in Stroma)**
|
22 |
+
- Uses **ATP** and **NADPH** from the light reactions.
|
23 |
+
- Carbon dioxide (CO₂) from the air is fixed and converted into glucose.
|
24 |
+
- This process does **not** require light directly but depends on the products of light reactions.
|
25 |
+
|
26 |
+
|
27 |
+
.
|
28 |
+
|
29 |
+
otosynthesis is the process by which green plants, algae, and some bacteria make their own food using sunlight. It mainly occurs in the leaves of plants..."""
|
30 |
+
prompts = [
|
31 |
+
"photosynthesis process diagram",
|
32 |
+
"green leaves with chlorophyll",
|
33 |
+
"plant roots absorbing water",
|
34 |
+
"sunlight on leaves",
|
35 |
+
"plant releasing oxygen",
|
36 |
+
"chemical equation photosynthesis",
|
37 |
+
"plants supporting life on Earth"
|
38 |
+
]
|
39 |
+
|
40 |
+
video_file = video_generation(text, prompts)
|
41 |
+
return redirect(video_file)
|
42 |
|
43 |
if __name__ == '__main__':
|
44 |
app.run(host='0.0.0.0', port=7860)
|