Update app.py
Browse files
app.py
CHANGED
@@ -135,7 +135,7 @@ def bot(
|
|
135 |
stream=True,
|
136 |
generation_config=generation_config,safety_settings=safety_settings)
|
137 |
response.resolve()
|
138 |
-
time.sleep(0.
|
139 |
|
140 |
out1 = response.text
|
141 |
|
@@ -147,6 +147,8 @@ def bot(
|
|
147 |
stream=True,
|
148 |
generation_config=generation_config, safety_settings=safety_settings)
|
149 |
response2.resolve()
|
|
|
|
|
150 |
|
151 |
elif image_prompt is None:
|
152 |
model = genai.GenerativeModel('gemini-pro')
|
@@ -158,7 +160,7 @@ def bot(
|
|
158 |
stream=True,
|
159 |
generation_config=generation_config,safety_settings=safety_settings)
|
160 |
response.resolve()
|
161 |
-
time.sleep(0.
|
162 |
|
163 |
out1 = response.text
|
164 |
|
@@ -170,6 +172,8 @@ def bot(
|
|
170 |
stream=True,
|
171 |
generation_config=generation_config, safety_settings=safety_settings)
|
172 |
response2.resolve()
|
|
|
|
|
173 |
|
174 |
else:
|
175 |
prompt= "اكتب لي وصف عن الصورة المرفقة "
|
@@ -180,7 +184,7 @@ def bot(
|
|
180 |
stream=True,
|
181 |
generation_config=generation_config, safety_settings=safety_settings)
|
182 |
response.resolve()
|
183 |
-
time.sleep(0.
|
184 |
out1 = response.text
|
185 |
|
186 |
prompt= "استخرج كلمات مفتاحية من النص التالي: "+out1
|
@@ -190,7 +194,7 @@ def bot(
|
|
190 |
stream=True,
|
191 |
generation_config=generation_config,safety_settings=safety_settings)
|
192 |
response1.resolve()
|
193 |
-
time.sleep(0.
|
194 |
|
195 |
out2 = response1.text
|
196 |
|
@@ -202,7 +206,7 @@ def bot(
|
|
202 |
stream=True,
|
203 |
generation_config=generation_config, safety_settings=safety_settings)
|
204 |
response2.resolve()
|
205 |
-
time.sleep(0.
|
206 |
|
207 |
|
208 |
|
|
|
135 |
stream=True,
|
136 |
generation_config=generation_config,safety_settings=safety_settings)
|
137 |
response.resolve()
|
138 |
+
time.sleep(0.2)
|
139 |
|
140 |
out1 = response.text
|
141 |
|
|
|
147 |
stream=True,
|
148 |
generation_config=generation_config, safety_settings=safety_settings)
|
149 |
response2.resolve()
|
150 |
+
time.sleep(0.2)
|
151 |
+
|
152 |
|
153 |
elif image_prompt is None:
|
154 |
model = genai.GenerativeModel('gemini-pro')
|
|
|
160 |
stream=True,
|
161 |
generation_config=generation_config,safety_settings=safety_settings)
|
162 |
response.resolve()
|
163 |
+
time.sleep(0.2)
|
164 |
|
165 |
out1 = response.text
|
166 |
|
|
|
172 |
stream=True,
|
173 |
generation_config=generation_config, safety_settings=safety_settings)
|
174 |
response2.resolve()
|
175 |
+
time.sleep(0.2)
|
176 |
+
|
177 |
|
178 |
else:
|
179 |
prompt= "اكتب لي وصف عن الصورة المرفقة "
|
|
|
184 |
stream=True,
|
185 |
generation_config=generation_config, safety_settings=safety_settings)
|
186 |
response.resolve()
|
187 |
+
time.sleep(0.2)
|
188 |
out1 = response.text
|
189 |
|
190 |
prompt= "استخرج كلمات مفتاحية من النص التالي: "+out1
|
|
|
194 |
stream=True,
|
195 |
generation_config=generation_config,safety_settings=safety_settings)
|
196 |
response1.resolve()
|
197 |
+
time.sleep(0.2)
|
198 |
|
199 |
out2 = response1.text
|
200 |
|
|
|
206 |
stream=True,
|
207 |
generation_config=generation_config, safety_settings=safety_settings)
|
208 |
response2.resolve()
|
209 |
+
time.sleep(0.3)
|
210 |
|
211 |
|
212 |
|