Upload folder using huggingface_hub
Browse files- .gradio/certificate.pem +31 -0
- .gradio/flagged/Upload Image optional/0ceefc13e18939759f71/Screenshot 2025-03-13 190037.png +0 -0
- .gradio/flagged/Upload Image optional/be30220a39fe6a4ec4c8/Neil Jadhav Light Doubt.png +0 -0
- .gradio/flagged/dataset1.csv +12 -0
- 681487a8a36e5_download.jpg +0 -0
- README.md +3 -9
- chat_logs.csv +411 -0
- chat_logs.csv.docx +0 -0
- main.py +177 -0
- requirements.txt +4 -0
- saved_images/img_20250602_212228.jpg +0 -0
- saved_images/img_20250602_213006.jpg +0 -0
.gradio/certificate.pem
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
-----BEGIN CERTIFICATE-----
|
2 |
+
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
|
31 |
+
-----END CERTIFICATE-----
|
.gradio/flagged/Upload Image optional/0ceefc13e18939759f71/Screenshot 2025-03-13 190037.png
ADDED
![]() |
.gradio/flagged/Upload Image optional/be30220a39fe6a4ec4c8/Neil Jadhav Light Doubt.png
ADDED
![]() |
.gradio/flagged/dataset1.csv
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Upload Image (optional),Your Question,output,timestamp
|
2 |
+
.gradio\flagged\Upload Image optional\0ceefc13e18939759f71\Screenshot 2025-03-13 190037.png,,"❌ Error: 'choices'
|
3 |
+
|
4 |
+
🔧 Full Response:
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
{""error"":{""message"":""Provider returned error"",""code"":429,""metadata"":{""raw"":""{\n \""id\"": \""npm6yUw-4pPsy7-92f0a2f643ee4284\"",\n \""error\"": {\n \""message\"": \""You have reached the rate limit specific to this model meta-llama/Llama-Vision-Free. The maximum rate limit for this model is 10.0 queries and 6000000 tokens per minute. This limit differs from the general rate limits published at Together AI rate limits documentation (https://docs.together.ai/docs/rate-limits). For inquiries about increasing your model-specific rate limit, please contact our sales team (https://www.together.ai/forms/contact-sales)\"",\n \""type\"": \""model_rate_limit\"",\n \""param\"": null,\n \""code\"": null\n }\n}"",""provider_name"":""Together""}},""user_id"":""user_2uRkw3mu8DAbxqtRy1KjTpzBRzz""}",2025-04-12 11:56:32.671469
|
12 |
+
.gradio\flagged\Upload Image optional\be30220a39fe6a4ec4c8\Neil Jadhav Light Doubt.png,,,2025-04-12 19:11:32.187432
|
681487a8a36e5_download.jpg
ADDED
![]() |
README.md
CHANGED
@@ -1,12 +1,6 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
|
4 |
-
colorFrom: pink
|
5 |
-
colorTo: indigo
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 5.
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: gradio_deploy
|
3 |
+
app_file: main.py
|
|
|
|
|
4 |
sdk: gradio
|
5 |
+
sdk_version: 5.23.3
|
|
|
|
|
6 |
---
|
|
|
|
chat_logs.csv
ADDED
@@ -0,0 +1,411 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
2025-06-02 20:47:30,what is reverse osmosis?,"Reverse osmosis RO is a water purification technology that uses a semipermeable membrane to remove ions, molecules, and larger particles from drinking water. In reverse osmosis, an external pressure is applied to overcome osmotic pressure, a colligative property, that is driven by chemical potential, a thermodynamic parameter. This is the reverse of the normal osmosis process, which is the natural movement of solvent from an area of low solute concentration, through a semipermeable membrane, to an area of high solute concentration.
|
2 |
+
|
3 |
+
Here's a simple breakdown:
|
4 |
+
|
5 |
+
1. **Osmosis**: In natural osmosis, water moves from an area of low solute like clean water to an area of high solute like salt water through a semipermeable membrane.
|
6 |
+
|
7 |
+
2. **Reverse Osmosis**: In reverse osmosis, pressure is applied to the high solute side to force water molecules through the membrane, leaving the solute behind. This results in purified water on the other side of the membrane.
|
8 |
+
|
9 |
+
Reverse osmosis can remove many types of dissolved and suspended chemicals and particles, including bacteria, fluoride, lead, mercury, sodium, and more. It's widely used for water purification, including desalination of seawater and wastewater recycling.
|
10 |
+
|
11 |
+
However, it's important to note that reverse osmosis can also remove beneficial minerals from water, and the process may require additional steps to remineralize the water before consumption. Additionally, reverse osmosis systems can produce a significant amount of wastewater or brine, which requires proper disposal.
|
12 |
+
|
13 |
+
Reverse osmosis systems typically include:
|
14 |
+
- A pre-filter to remove large particles and chlorine
|
15 |
+
- The reverse osmosis membrane to remove contaminants
|
16 |
+
- A post-filter to polish the water before it's dispensed
|
17 |
+
- Some systems also include a remineralization step to add beneficial minerals back into the water"
|
18 |
+
2025-06-02 20:47:56,,**Step 1: Understanding the Problem**
|
19 |
+
2025-06-02 20:48:16,,**Step 1: Understand the Problem and Identify Relevant Concepts**
|
20 |
+
2025-06-02 20:48:28,,"The image presents a diagram illustrating the behavior of a waterproof laser immersed in water, shining light towards the horizontal surface. The diagram is accompanied by a descriptive text that explains the phenomenon depicted.
|
21 |
+
|
22 |
+
**Diagram:**
|
23 |
+
|
24 |
+
* The diagram shows a waterproof laser submerged in water.
|
25 |
+
* The laser emits a beam of light that hits the horizontal surface of the water at an angle θ.
|
26 |
+
* The angle θ is measured relative to the normal perpendicular to the water's surface.
|
27 |
+
* The diagram labels the different components involved:
|
28 |
+
* Air
|
29 |
+
* Water
|
30 |
+
* Normal
|
31 |
+
* Beam of light
|
32 |
+
* Laser
|
33 |
+
* Movement of laser
|
34 |
+
|
35 |
+
**Descriptive Text:**
|
36 |
+
|
37 |
+
* Initially, the angle θ is much less than the critical angle for this light in water.
|
38 |
+
* As the laser moves, θ gradually increases until it is much greater than the critical angle.
|
39 |
+
* The text asks the viewer to describe what happens to the light beam after it hits the surface for different angles of the laser.
|
40 |
+
|
41 |
+
**Key Concepts:**
|
42 |
+
|
43 |
+
* **Refraction:** The bending of light as it passes from one medium to another with a different optical density.
|
44 |
+
* **Critical Angle:** The angle of incidence above which total internal reflection occurs when light attempts to pass from a denser medium to a rarer medium.
|
45 |
+
* **Total Internal Reflection:** The complete reflection of light back into the denser medium when the angle of incidence exceeds the critical angle.
|
46 |
+
|
47 |
+
**Explanation:**
|
48 |
+
|
49 |
+
1. When the angle θ is less than the critical angle, the light beam is refracted out of the water into the air.
|
50 |
+
2. As θ approaches the critical angle, the refracted beam becomes more grazing, eventually reaching an angle of 90 degrees relative to the normal at the critical angle.
|
51 |
+
3. Once θ exceeds the critical angle, the light beam undergoes total internal reflection, remaining within the water and not escaping into the air.
|
52 |
+
|
53 |
+
In summary, the diagram and accompanying text illustrate how the angle of incidence affects the behavior of light as it hits the water's surface, transitioning from refraction to total internal reflection as the angle increases beyond the critical angle."
|
54 |
+
2025-06-02 20:53:49,,**Step 1: Understand the Problem**
|
55 |
+
2025-06-02 20:54:04,,"**Step 1: Understand the Problem and Identify Given Information**
|
56 |
+
|
57 |
+
* The mass of the tennis ball is 0.060 \, .
|
58 |
+
* Initial velocity of the ball before hitting the racket is 25 \, to the right.
|
59 |
+
* Final velocity of the ball after hitting the racket is 40 \, to the left.
|
60 |
+
* The time the ball is in contact with the racket is 50 \, or 0.05 \, .
|
61 |
+
|
62 |
+
**Step 2: Apply the Concept of Momentum and Impulse**
|
63 |
+
|
64 |
+
To solve this problem, we will use the concept that the force exerted on an object is equal to the rate of change of its momentum. The formula relating force F, change in momentum p, and time t is given by:
|
65 |
+
|
66 |
+
\ F = t \
|
67 |
+
|
68 |
+
The change in momentum p can be calculated using the formula:
|
69 |
+
|
70 |
+
\ p = mv_f - v_i \
|
71 |
+
|
72 |
+
where m is the mass of the object, v_i is the initial velocity, and v_f is the final velocity.
|
73 |
+
|
74 |
+
**Step 3: Calculate the Change in Momentum**
|
75 |
+
|
76 |
+
First, we need to correctly assign the direction of velocities. Let's consider the initial direction of the ball to the right as positive. Thus, v_i = +25 \, and v_f = -40 \, because it rebounds to the left.
|
77 |
+
|
78 |
+
\ p = 0.060 \, -40 \, - 25 \, \
|
79 |
+
\ p = 0.060 \, -65 \, \
|
80 |
+
\ p = -3.9 \, \
|
81 |
+
|
82 |
+
The negative sign indicates that the change in momentum is directed to the left.
|
83 |
+
|
84 |
+
**Step 4: Calculate the Force Exerted by the Racket**
|
85 |
+
|
86 |
+
Now, we calculate the force exerted by the racket on the ball using the formula F = t.
|
87 |
+
|
88 |
+
\ F = 0.05 \, \
|
89 |
+
\ F = -78 \, \
|
90 |
+
|
91 |
+
The negative sign indicates the direction of the force, which is to the left. However, since the question asks for the magnitude of the force, we consider the absolute value.
|
92 |
+
|
93 |
+
\ |F| = 78 \, \
|
94 |
+
|
95 |
+
**Conclusion**
|
96 |
+
|
97 |
+
The correct answer is **D 78 N**."
|
98 |
+
2025-06-02 20:54:43,,"**Step 1: Understand the Problem and Identify the Forces Involved**
|
99 |
+
|
100 |
+
The problem involves a long plank XY lying on the ground with a load of 120 N placed on it at a distance of 0.50 m from end X. The task is to find the weight of the plank, denoted as W, when end Y is lifted off the ground by applying an upward force of 65 N.
|
101 |
+
|
102 |
+
**Step 2: Analyze the Forces Acting on the Plank**
|
103 |
+
|
104 |
+
* The forces acting on the plank are:
|
105 |
+
* The weight of the load 120 N at 0.50 m from X.
|
106 |
+
* The weight of the plank W acting at its midpoint.
|
107 |
+
* The upward force 65 N applied at end Y.
|
108 |
+
|
109 |
+
**Step 3: Calculate the Length of the Plank and the Position of Its Midpoint**
|
110 |
+
|
111 |
+
* The total length of the plank is the sum of the distances given: 0.50 m + 1.5 m + 2.0 m = 4.0 m.
|
112 |
+
* The midpoint of the plank is at half of its total length, which is 4.0 m / 2 = 2.0 m from either end.
|
113 |
+
|
114 |
+
**Step 4: Apply the Principle of Moments to Solve for W**
|
115 |
+
|
116 |
+
To solve for W, we apply the principle of moments about point X. The sum of clockwise moments equals the sum of counterclockwise moments.
|
117 |
+
|
118 |
+
* Clockwise moments: 120 \, 0.50 \, + W 2.0 \,
|
119 |
+
* Counterclockwise moments: 65 \, 4.0 \,
|
120 |
+
|
121 |
+
Setting the clockwise moments equal to the counterclockwise moments gives:
|
122 |
+
|
123 |
+
120 0.50 + W 2.0 = 65 4.0
|
124 |
+
|
125 |
+
**Step 5: Perform the Calculation**
|
126 |
+
|
127 |
+
60 + 2W = 260
|
128 |
+
|
129 |
+
Subtract 60 from both sides:
|
130 |
+
|
131 |
+
2W = 200
|
132 |
+
|
133 |
+
Divide by 2:
|
134 |
+
|
135 |
+
W = 100 \,
|
136 |
+
|
137 |
+
**Conclusion:**
|
138 |
+
|
139 |
+
The value of W, the weight of the plank, is **100 N**. Therefore, the correct answer is **C 100N**."
|
140 |
+
2025-06-02 20:56:23,"1 (a) The nutrient content of five different foods was analysed.
|
141 |
+
The mass of each nutrient per 100 g of food was estimated.
|
142 |
+
Table 1.1 shows the results.
|
143 |
+
Table 1.1
|
144 |
+
mass of nutrient per 100 g of food / g
|
145 |
+
food carbohydrates fats protein fibre
|
146 |
+
A 12 1 5 6
|
147 |
+
B 23 8 14 2
|
148 |
+
C 0 36 25 0
|
149 |
+
D 7 54 28 7
|
150 |
+
E 21 7 5 8
|
151 |
+
The recommended daily allowance for these nutrients for an adult is:
|
152 |
+
• fat – a maximum of 70 g per day
|
153 |
+
• protein – 50 g per day.
|
154 |
+
(i) Identify the food in Table 1.1 which contains the most carbohydrate per 100 g.","To determine which food contains the most carbohydrate per 100 g, we need to examine the ""carbohydrates"" column in Table 1.1.
|
155 |
+
|
156 |
+
The values for carbohydrates per 100 g of food are as follows:
|
157 |
+
|
158 |
+
* Food A: 12 g
|
159 |
+
* Food B: 23 g
|
160 |
+
* Food C: 0 g
|
161 |
+
* Food D: 7 g
|
162 |
+
* Food E: 21 g
|
163 |
+
|
164 |
+
Comparing these values, we find that Food B has the highest carbohydrate content per 100 g at 23 g.
|
165 |
+
|
166 |
+
Therefore, the food that contains the most carbohydrate per 100 g is **B**."
|
167 |
+
2025-06-02 20:57:33,"1 (a) The nutrient content of five different foods was analysed.
|
168 |
+
The mass of each nutrient per 100 g of food was estimated.
|
169 |
+
Table 1.1 shows the results.
|
170 |
+
Table 1.1
|
171 |
+
mass of nutrient per 100 g of food / g
|
172 |
+
food carbohydrates fats protein fibre
|
173 |
+
A 12 1 5 6
|
174 |
+
B 23 8 14 2
|
175 |
+
C 0 36 25 0
|
176 |
+
D 7 54 28 7
|
177 |
+
E 21 7 5 8
|
178 |
+
The recommended daily allowance for these nutrients for an adult is:
|
179 |
+
• fat – a maximum of 70 g per day
|
180 |
+
• protein – 50 g per day.
|
181 |
+
(i) Identify the food in Table 1.1 which contains the most carbohydrate per 100 g.","To identify the food that contains the most carbohydrate per 100 g, we need to look at the values in the ""carbohydrates"" column of Table 1.1.
|
182 |
+
|
183 |
+
**Step 1: Examine the ""carbohydrates"" column in Table 1.1.**
|
184 |
+
|
185 |
+
| Food | Carbohydrates |
|
186 |
+
| --- | --- |
|
187 |
+
| A | 12 |
|
188 |
+
| B | 23 |
|
189 |
+
| C | 0 |
|
190 |
+
| D | 7 |
|
191 |
+
| E | 21 |
|
192 |
+
|
193 |
+
**Step 2: Compare the carbohydrate values for each food.**
|
194 |
+
|
195 |
+
* Food A: 12 g
|
196 |
+
* Food B: 23 g
|
197 |
+
* Food C: 0 g
|
198 |
+
* Food D: 7 g
|
199 |
+
* Food E: 21 g
|
200 |
+
|
201 |
+
**Step 3: Identify the food with the highest carbohydrate content.**
|
202 |
+
|
203 |
+
The highest value in the ""carbohydrates"" column is 23 g, which corresponds to **Food B**.
|
204 |
+
|
205 |
+
**Answer:** Food B"
|
206 |
+
2025-06-02 20:57:59,,"The image presents a photomicrograph of the lower surface of a leaf, labeled as Fig. 2.3, accompanied by two questions related to the figure.
|
207 |
+
|
208 |
+
**Step 1: Identify the Cell Labeled X**
|
209 |
+
|
210 |
+
To answer the first question, we need to examine the photomicrograph and identify the cell labeled X.
|
211 |
+
|
212 |
+
* The cell labeled X is surrounding a stoma.
|
213 |
+
* The stoma is a small opening on the surface of the leaf that allows for gas exchange between the plant and its environment.
|
214 |
+
* The cells surrounding the stoma are specialized cells known as guard cells.
|
215 |
+
|
216 |
+
**Step 2: Determine the Name of the Cell Labeled X**
|
217 |
+
|
218 |
+
Based on the information provided in Step 1, we can determine that the cell labeled X is a guard cell.
|
219 |
+
|
220 |
+
* Guard cells are responsible for controlling the opening and closing of the stomata.
|
221 |
+
* They are typically kidney-shaped or bean-shaped and contain chloroplasts.
|
222 |
+
|
223 |
+
**Step 3: Identify One Structure that Identifies the Cells in Fig. 2.3 as Plant Cells**
|
224 |
+
|
225 |
+
To answer the second question, we need to examine the photomicrograph and identify one structure that indicates the cells are plant cells.
|
226 |
+
|
227 |
+
* The presence of a cell wall is a characteristic feature of plant cells.
|
228 |
+
* The cells in Fig. 2.3 have visible cell walls, which are rigid structures that provide support and protection to the cells.
|
229 |
+
|
230 |
+
**Conclusion**
|
231 |
+
|
232 |
+
i The name of the cell labeled X in Fig. 2.3 is a **guard cell**.
|
233 |
+
|
234 |
+
ii One structure that identifies the cells in Fig. 2.3 as plant cells is the **cell wall**."
|
235 |
+
2025-06-02 20:58:40,,"**Problem Statement**
|
236 |
+
|
237 |
+
Solve the following system of linear equations:
|
238 |
+
|
239 |
+
|
240 |
+
|
241 |
+
5a + 2c &= 10 \\
|
242 |
+
2a - 4c &= 7
|
243 |
+
|
244 |
+
|
245 |
+
|
246 |
+
**Step-by-Step Solution**
|
247 |
+
|
248 |
+
To solve this system, we will use the method of substitution or elimination. Here, we opt for the elimination method as it seems more straightforward with the given coefficients.
|
249 |
+
|
250 |
+
### Step 1: Multiply the Equations by Necessary Multiples
|
251 |
+
|
252 |
+
First, we need to make the coefficients of either a or c the same in both equations but with opposite signs. Let's eliminate c. To do this, we can multiply the first equation by 2, so the coefficient of c becomes 4, matching the absolute value of the coefficient of c in the second equation but with the opposite sign.
|
253 |
+
|
254 |
+
* Multiply the first equation by 2:
|
255 |
+
|
256 |
+
25a + 2c = 210 10a + 4c = 20
|
257 |
+
|
258 |
+
* The second equation remains 2a - 4c = 7.
|
259 |
+
|
260 |
+
### Step 2: Add the Two Equations to Eliminate c
|
261 |
+
|
262 |
+
Now, add the modified first equation and the second equation to eliminate c.
|
263 |
+
|
264 |
+
|
265 |
+
|
266 |
+
10a + 4c + 2a - 4c &= 20 + 7 \\
|
267 |
+
12a &= 27 \\
|
268 |
+
a &= 12 = 4
|
269 |
+
|
270 |
+
|
271 |
+
|
272 |
+
### Step 3: Substitute a Back into One of the Original Equations to Find c
|
273 |
+
|
274 |
+
Substitute a = 4 into the first original equation:
|
275 |
+
|
276 |
+
|
277 |
+
|
278 |
+
54 + 2c &= 10 \\
|
279 |
+
4 + 2c &= 10 \\
|
280 |
+
2c &= 10 - 4 \\
|
281 |
+
2c &= 4 \\
|
282 |
+
2c &= -4 \\
|
283 |
+
c &= -8
|
284 |
+
|
285 |
+
|
286 |
+
|
287 |
+
### Step 4: State the Solution
|
288 |
+
|
289 |
+
The solution to the system of equations is a = 4 and c = -8.
|
290 |
+
|
291 |
+
**Conclusion**
|
292 |
+
|
293 |
+
The values that satisfy both equations are a = 4 and c = -8."
|
294 |
+
2025-06-02 20:59:25,"Chromosomes contain genetic information in the form of genes.
|
295 |
+
(i) Define the term gene.
|
296 |
+
...........................................................................................................................................
|
297 |
+
..................................................................................................................................... [2]
|
298 |
+
(ii) State where chromosomes are found in cells.
|
299 |
+
..................................................................................................................................... [1]
|
300 |
+
(iii) State the chromosomes involved in the inheritance of sex in humans.","i **Gene**: A gene is a basic unit of heredity that corresponds to a specific segment of DNA deoxyribonucleic acid on a chromosome. It contains the information necessary to produce a specific protein or RNA molecule, which in turn contributes to the organism's characteristics and traits.
|
301 |
+
|
302 |
+
ii **Location of Chromosomes in Cells**: Chromosomes are found in the nucleus of eukaryotic cells. They are not present in the cytoplasm or other organelles.
|
303 |
+
|
304 |
+
iii **Chromosomes Involved in the Inheritance of Sex in Humans**: The chromosomes involved in the inheritance of sex in humans are the X and Y chromosomes. Typically, females have two X chromosomes XX, and males have one X and one Y chromosome XY."
|
305 |
+
2025-06-02 21:00:02,"Salmonella bacteria can cause food poisoning. Salmonella bacteria are able to reproduce
|
306 |
+
when the temperature is between 5.2 °C and 46.0 °C. Salmonella bacteria are killed after
|
307 |
+
10 minutes at 75 °C.
|
308 |
+
Using this information and your knowledge, suggest ways of preventing the spread of food
|
309 |
+
poisoning caused by Salmonella bacteria.","Preventing the spread of food poisoning caused by Salmonella bacteria involves several key steps centered around controlling temperature, proper cooking, and maintaining good hygiene practices. Here are several strategies:
|
310 |
+
|
311 |
+
1. **Proper Food Storage**:
|
312 |
+
- **Refrigeration**: Keep perishable foods refrigerated below 5.2°C 41°F. This slows down the reproduction of Salmonella bacteria and helps prevent them from multiplying.
|
313 |
+
- **Freezing**: Freezing foods can also prevent bacterial growth. Ensure that the temperature in the freezer is kept at or below -18°C 0°F.
|
314 |
+
|
315 |
+
2. **Avoid the Danger Zone**:
|
316 |
+
- The ""danger zone"" for bacteria is between 5.2°C 41°F and 46.0°C 115°F. Avoid keeping foods in this temperature range for extended periods, such as leaving them out on the counter.
|
317 |
+
|
318 |
+
3. **Thorough Cooking**:
|
319 |
+
- Cook foods to a minimum internal temperature of 75°C 165°F to ensure that any existing Salmonella bacteria are killed. Use a food thermometer to check the internal temperature.
|
320 |
+
- Properly cook meats, poultry, eggs, and other high-risk foods.
|
321 |
+
|
322 |
+
4. **Prompt Cooling and Reheating**:
|
323 |
+
- Cool cooked foods rapidly by dividing large quantities into smaller portions prior to cooling. Store them in shallow containers to speed upcooling.
|
324 |
+
- Reheat foods to at least 75°C 165°F to kill any bacteria that might have grown during storage.
|
325 |
+
|
326 |
+
5. **Good Hygiene**:
|
327 |
+
- **Wash Hands**: Before and after handling food, wash hands thoroughly with soap and warm water for at least 20 seconds.
|
328 |
+
- **Clean Utensils**: Clean and sanitize cutting boards, utensils, and countertops regularly.
|
329 |
+
- **Avoid Cross-Contamination**: Use separate cutting boards for raw and cooked foods to prevent bacteria from spreading. Store raw foods separately from ready-to-eat foods.
|
330 |
+
- **Cooked Foods**: Do not place cooked foods back on the same plate or surface that held raw foods.
|
331 |
+
|
332 |
+
6. **High-Risk Foods**:
|
333 |
+
- Be particularly careful with high-risk foods such as raw meat, poultry, eggs, and unpasteurized dairy products. These foods are more likely to harbor Salmonella bacteria.
|
334 |
+
|
335 |
+
7. **Education and Awareness**:
|
336 |
+
- Educate yourself and others about safe food handling practices. Proper training and awareness can drastically reduce the risk of Salmonella contamination.
|
337 |
+
|
338 |
+
By following these steps, you can significantly reduce the risk of Salmonella bacteria spreading and causing food poisoning."
|
339 |
+
2025-06-02 21:22:39,,"**Step 1: Understand the Problem and Identify Key Concepts**
|
340 |
+
|
341 |
+
The problem involves a waterproof laser immersed in water, shining light upwards towards the horizontal surface of the water. The angle between the laser beam and the normal to the water's surface is initially less than the critical angle for this light in water and gradually increases.
|
342 |
+
|
343 |
+
* The key concepts involved are:
|
344 |
+
* Refraction of light
|
345 |
+
* Critical angle
|
346 |
+
* Total internal reflection
|
347 |
+
|
348 |
+
**Step 2: Describe the Behavior of Light as it Hits the Water-Air Interface**
|
349 |
+
|
350 |
+
When the laser beam hits the water-air interface, it can either be refracted into the air or undergo total internal reflection back into the water, depending on the angle of incidence.
|
351 |
+
|
352 |
+
* Initially, when is much less than the critical angle, the light is refracted into the air because the angle of incidence is less than the critical angle.
|
353 |
+
* As increases and approaches the critical angle, the refracted beam becomes more glancing, bending away from the normal as it enters the air.
|
354 |
+
* At the critical angle, the refracted beam travels along the surface of the water.
|
355 |
+
* When exceeds the critical angle, the light is completely reflected back into the water due to total internal reflection.
|
356 |
+
|
357 |
+
**Step 3: Explain the Phenomena Observed for Different Angles of the Laser**
|
358 |
+
|
359 |
+
* **For much less than the critical angle**: The laser beam is refracted into the air. The angle of refraction is greater than the angle of incidence due to the transition from a denser medium water to a rarer medium air.
|
360 |
+
* **As approaches the critical angle**: The refracted beam becomes more glancing, with the angle of refraction approaching 90 degrees. The intensity of the refracted beam decreases, and the intensity of the reflected beam increases.
|
361 |
+
* **At the critical angle**: The refracted beam travels along the surface of the water. The angle of refraction is 90 degrees.
|
362 |
+
* **For greater than the critical angle**: The laser beam undergoes total internal reflection. No light is refracted into the air; instead, it is reflected back into the water.
|
363 |
+
|
364 |
+
**Conclusion**
|
365 |
+
|
366 |
+
In conclusion, as the angle increases from being much less than the critical angle to being much greater, the behavior of the laser beam changes significantly. Initially, it is refracted into the air. As approaches and then exceeds the critical angle, the beam undergoes total internal reflection, with no light escaping into the air. This phenomenon is a direct result of Snell's law and the principles governing total internal reflection.",saved_images\img_20250602_212228.jpg
|
367 |
+
2025-06-02 21:30:16,,"**Step 1: Understand the Problem**
|
368 |
+
|
369 |
+
The problem involves a car with a mass of 1400 kg, initially at rest, being moved along a level road by a resultant force of 3500 N. The car accelerates to a speed of 30 m/s.
|
370 |
+
|
371 |
+
**Step 2: Identify Given Information**
|
372 |
+
|
373 |
+
* Mass of the car m = 1400 kg
|
374 |
+
* Resultant force applied F = 3500 N
|
375 |
+
* Initial velocity u = 0 m/s since it's initially at rest
|
376 |
+
* Final velocity v = 30 m/s
|
377 |
+
|
378 |
+
**Step 3: Calculate Average Acceleration**
|
379 |
+
|
380 |
+
To calculate the average acceleration, we use Newton's second law of motion, which states that the net force acting on an object is equal to its mass times its acceleration F = ma.
|
381 |
+
|
382 |
+
* Rearranging for acceleration gives us a = m.
|
383 |
+
* Substituting the given values: a = 1400 = 2.5 \, ^2.
|
384 |
+
|
385 |
+
**Step 4: Calculate Time for Which the Force is Applied**
|
386 |
+
|
387 |
+
We can use the equation of motion to find the time taken for the car to reach 30 m/s from rest under constant acceleration.
|
388 |
+
|
389 |
+
* The relevant equation is v = u + at, where v is the final velocity, u is the initial velocity, a is the acceleration, and t is the time.
|
390 |
+
* Substituting the known values: 30 = 0 + 2.5t.
|
391 |
+
* Solving for t: t = 2.5 = 12 \, .
|
392 |
+
|
393 |
+
**Conclusion**
|
394 |
+
|
395 |
+
i The average acceleration of the car is **2.5 m/s^2**.
|
396 |
+
|
397 |
+
ii The time for which the force is applied is **12 seconds**.",saved_images\img_20250602_213006.jpg
|
398 |
+
2025-06-02 21:31:42,"A large surface area is one feature of gas exchange surfaces in humans.
|
399 |
+
State two other features.
|
400 |
+
1 ................................................................................................................................................
|
401 |
+
2 ................................................................................................................................................","### Features of Gas Exchange Surfaces in Humans
|
402 |
+
|
403 |
+
Gas exchange surfaces in humans are specialized to maximize the efficiency of gas exchange, particularly in the lungs. Here are two other features, apart from a large surface area:
|
404 |
+
|
405 |
+
1. **Thin epithelial tissue:**
|
406 |
+
- The gas exchange surfaces in the lungs are lined with a thin layer of epithelial cells. This thin layer minimizes the distance that oxygen and carbon dioxide have to travel, facilitating rapid diffusion.
|
407 |
+
|
408 |
+
2. **Moist surface:**
|
409 |
+
- The surfaces are kept moist by a thin layer of mucus. This moisture ensures that gases can dissolve easily before diffusing across the epithelial barrier, which is crucial for gases oxygen and carbon dioxide to move between the air and the bloodstream efficiently.
|
410 |
+
|
411 |
+
These features ensure that gas exchange is rapid and effective, allowing the body to meet its oxygen demands and expel carbon dioxide efficiently.",
|
chat_logs.csv.docx
ADDED
Binary file (11.7 kB). View file
|
|
main.py
ADDED
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import requests
|
3 |
+
import base64
|
4 |
+
import os
|
5 |
+
import re
|
6 |
+
import csv
|
7 |
+
from datetime import datetime
|
8 |
+
from pathlib import Path
|
9 |
+
|
10 |
+
# API Key and model lists
|
11 |
+
API_KEY = "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"
|
12 |
+
VISION_MODELS = [
|
13 |
+
"meta-llama/llama-4-maverick:free",
|
14 |
+
"google/gemini-pro-vision:free",
|
15 |
+
"openai/gpt-4-vision-preview"
|
16 |
+
"google/gemini-2.0-flash-exp:free"
|
17 |
+
]
|
18 |
+
TEXT_MODELS = [
|
19 |
+
"mistralai/devstral-small:free",
|
20 |
+
"openchat/openchat-3.5-1210:free",
|
21 |
+
"nousresearch/nous-capybara-7b:free"
|
22 |
+
"deepseek/deepseek-r1-0528:free"
|
23 |
+
"deepseek/deepseek-chat-v3-0324:free"
|
24 |
+
]
|
25 |
+
|
26 |
+
# Ensure ./data and ./data/saved_images exist
|
27 |
+
BASE_DATA_FOLDER = Path("data")
|
28 |
+
BASE_DATA_FOLDER.mkdir(exist_ok=True)
|
29 |
+
|
30 |
+
IMAGE_SAVE_FOLDER = BASE_DATA_FOLDER / "saved_images"
|
31 |
+
IMAGE_SAVE_FOLDER.mkdir(exist_ok=True)
|
32 |
+
|
33 |
+
LOG_FILE = BASE_DATA_FOLDER / "chat_logs.csv"
|
34 |
+
|
35 |
+
# Memory to store conversation context
|
36 |
+
chat_history = []
|
37 |
+
|
38 |
+
# Text cleaning function
|
39 |
+
def clean_text(text):
|
40 |
+
text = re.sub(r"\\[a-zA-Z]+\{.*?\}", "", text)
|
41 |
+
text = re.sub(r"\\[a-zA-Z]+", "", text)
|
42 |
+
text = re.sub(r"\$+", "", text)
|
43 |
+
text = re.sub(r"[\{\}\[\]\(\)]", "", text)
|
44 |
+
return text.strip()
|
45 |
+
|
46 |
+
# Function to query a model
|
47 |
+
|
48 |
+
def try_model(image_b64, question, model_name, is_vision=False):
|
49 |
+
headers = {
|
50 |
+
"Authorization": f"Bearer {API_KEY}",
|
51 |
+
"Content-Type": "application/json"
|
52 |
+
}
|
53 |
+
|
54 |
+
messages = chat_history.copy() # maintain context
|
55 |
+
content = [{"type": "text", "text": question}]
|
56 |
+
if is_vision:
|
57 |
+
content.append({
|
58 |
+
"type": "image_url",
|
59 |
+
"image_url": {"url": f"data:image/jpeg;base64,{image_b64}"}
|
60 |
+
})
|
61 |
+
|
62 |
+
messages.append({"role": "user", "content": content})
|
63 |
+
|
64 |
+
payload = {
|
65 |
+
"model": model_name,
|
66 |
+
"messages": messages
|
67 |
+
}
|
68 |
+
|
69 |
+
response = requests.post("https://openrouter.ai/api/v1/chat/completions", json=payload, headers=headers)
|
70 |
+
try:
|
71 |
+
data = response.json()
|
72 |
+
if "error" in data:
|
73 |
+
raise Exception(data["error"].get("message", "Unknown error"))
|
74 |
+
return data["choices"][0]["message"]["content"]
|
75 |
+
except Exception:
|
76 |
+
return None
|
77 |
+
|
78 |
+
# Main chatbot function
|
79 |
+
def ask_bot(image, question):
|
80 |
+
image_path = ""
|
81 |
+
image_b64 = None
|
82 |
+
|
83 |
+
if image:
|
84 |
+
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
85 |
+
image_path = str(IMAGE_SAVE_FOLDER / f"img_{timestamp}.jpg")
|
86 |
+
image.save(image_path)
|
87 |
+
with open(image_path, "rb") as f:
|
88 |
+
image_b64 = base64.b64encode(f.read()).decode("utf-8")
|
89 |
+
|
90 |
+
models = VISION_MODELS if image_b64 else TEXT_MODELS
|
91 |
+
|
92 |
+
answer = None
|
93 |
+
for model in models:
|
94 |
+
result = try_model(image_b64, question, model, is_vision=bool(image_b64))
|
95 |
+
if result:
|
96 |
+
answer = result
|
97 |
+
break
|
98 |
+
|
99 |
+
if not answer:
|
100 |
+
answer = "❌ All free models have exceeded their daily limit or failed."
|
101 |
+
|
102 |
+
clean_answer = clean_text(answer)
|
103 |
+
|
104 |
+
# Store in memory for follow-ups
|
105 |
+
chat_history.append({"role": "assistant", "content": clean_answer})
|
106 |
+
|
107 |
+
with open(LOG_FILE, "a", newline="", encoding="utf-8") as f:
|
108 |
+
writer = csv.writer(f)
|
109 |
+
writer.writerow([
|
110 |
+
datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
111 |
+
question,
|
112 |
+
clean_answer,
|
113 |
+
image_path
|
114 |
+
])
|
115 |
+
|
116 |
+
return clean_answer
|
117 |
+
|
118 |
+
logo_path = r"681487a8a36e5_download.jpg"
|
119 |
+
|
120 |
+
def encode_image_to_base64(image_path):
|
121 |
+
if not os.path.exists(image_path):
|
122 |
+
return None
|
123 |
+
with open(image_path, "rb") as img_file:
|
124 |
+
encoded = base64.b64encode(img_file.read()).decode("utf-8")
|
125 |
+
return f"data:image/jpeg;base64,{encoded}"
|
126 |
+
|
127 |
+
encoded_logo = encode_image_to_base64(logo_path)
|
128 |
+
|
129 |
+
# Encode the logo image to base64
|
130 |
+
def encode_image_to_base64(image_path):
|
131 |
+
if not os.path.exists(image_path):
|
132 |
+
return None
|
133 |
+
with open(image_path, "rb") as img_file:
|
134 |
+
encoded = base64.b64encode(img_file.read()).decode("utf-8")
|
135 |
+
return f"data:image/jpeg;base64,{encoded}"
|
136 |
+
|
137 |
+
logo_path = "681487a8a36e5_download.jpg"
|
138 |
+
encoded_logo = encode_image_to_base64(logo_path)
|
139 |
+
|
140 |
+
# Gradio UI with welcome message
|
141 |
+
with gr.Blocks(css="footer {display: none !important;}") as demo:
|
142 |
+
with gr.Row(elem_id="header-row"):
|
143 |
+
gr.HTML(f"""
|
144 |
+
<div style="
|
145 |
+
display: flex;
|
146 |
+
align-items: center;
|
147 |
+
gap: 15px;
|
148 |
+
padding: 15px 20px;
|
149 |
+
background-color: #f5f5f5;
|
150 |
+
border-radius: 12px;
|
151 |
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
152 |
+
width: 100%;
|
153 |
+
">
|
154 |
+
<img src="{encoded_logo}" style="height: 50px; width: 50px; border-radius: 8px;">
|
155 |
+
<h1 style="
|
156 |
+
font-family: 'Segoe UI', sans-serif;
|
157 |
+
font-size: 28px;
|
158 |
+
margin: 0;
|
159 |
+
color: #333;
|
160 |
+
">Camb AI</h1>
|
161 |
+
</div>
|
162 |
+
""")
|
163 |
+
|
164 |
+
with gr.Row():
|
165 |
+
image_input = gr.Image(type="pil", label="📸 Upload an Image (optional)")
|
166 |
+
question_input = gr.Textbox(label="📝 Ask something", placeholder="What would you like to know?")
|
167 |
+
|
168 |
+
submit_btn = gr.Button(" Submit")
|
169 |
+
output_box = gr.Textbox(label="💡 Answer", lines=4)
|
170 |
+
|
171 |
+
submit_btn.click(fn=ask_bot, inputs=[image_input, question_input], outputs=output_box)
|
172 |
+
|
173 |
+
demo.load(lambda: " Hi! I'm Camb AI. Ask me anything!", outputs=output_box)
|
174 |
+
|
175 |
+
# Launch the app
|
176 |
+
if __name__ == "__main__":
|
177 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
gradio
|
2 |
+
requests
|
3 |
+
pillow
|
4 |
+
datetime
|
saved_images/img_20250602_212228.jpg
ADDED
![]() |
saved_images/img_20250602_213006.jpg
ADDED
![]() |