'rer'
Browse files- app.py +36 -3
- requirements.txt +1 -3
app.py
CHANGED
@@ -206,6 +206,27 @@ def calcul(math, francais, physique, svt, philo, eps, thea, hist, anglais):
|
|
206 |
r = total / 28
|
207 |
return matha.trunc(r * 100) / 100
|
208 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
|
210 |
# interface 1
|
211 |
app1 = gr.Interface(
|
@@ -291,9 +312,21 @@ app5 = gr.Interface(
|
|
291 |
description=description_c,
|
292 |
)
|
293 |
|
294 |
-
|
295 |
-
|
296 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
)
|
298 |
|
|
|
|
|
|
|
|
|
|
|
299 |
demo.launch()
|
|
|
206 |
r = total / 28
|
207 |
return matha.trunc(r * 100) / 100
|
208 |
|
209 |
+
def mariam_web(pro):
|
210 |
+
if not pro:
|
211 |
+
return "Veuillez saisir une question."
|
212 |
+
|
213 |
+
t_pro = " agis en tant q'ia appele mariam et creer par youssouf. ton role est uniquement d'assister. reponds a cette question: " + pro
|
214 |
+
answer = client.predict(
|
215 |
+
t_pro, # str in 'input_text' Textbox component
|
216 |
+
api_name="/predict")
|
217 |
+
|
218 |
+
|
219 |
+
print(answer)
|
220 |
+
return answer
|
221 |
+
|
222 |
+
def mariam_chimi(chi,im):
|
223 |
+
|
224 |
+
prompt_chi = " tu es un expert en chimie, tu as 20 d'expreriance dans le domaine. reponds a cette question: " + chi
|
225 |
+
if not im :
|
226 |
+
answer = client.predict(
|
227 |
+
t_pro, # str in 'input_text' Textbox component
|
228 |
+
api_name="/predict"
|
229 |
+
|
230 |
|
231 |
# interface 1
|
232 |
app1 = gr.Interface(
|
|
|
312 |
description=description_c,
|
313 |
)
|
314 |
|
315 |
+
app7 = gr.Interface(
|
316 |
+
fn=mariam_web,
|
317 |
+
inputs=[gr.TextBox],
|
318 |
+
outputs=gr.TextBox(label="Reponse")
|
319 |
+
)
|
320 |
+
|
321 |
+
app8 = gr.Interface(
|
322 |
+
fn = mariam_chimi,
|
323 |
+
input=[gr.TextBox, gr.Image(type="pil")],
|
324 |
+
outputs=[gr.Textbox(label='Reponse')],
|
325 |
)
|
326 |
|
327 |
+
demo = gr.TabbedInterface(
|
328 |
+
[app1, app2, app3,app4,app6,app5,app7,app8],
|
329 |
+
["OCR", "MARIAM-u", "Mariam-French", "Mariam-Philo","Mariam-Hist", "Note Calc","Mariam-web","Mariam-chimi"]
|
330 |
+
|
331 |
+
|
332 |
demo.launch()
|
requirements.txt
CHANGED
@@ -1,3 +1 @@
|
|
1 |
-
gradio
|
2 |
-
pypdf2
|
3 |
-
openai
|
|
|
1 |
+
gradio
|
|
|
|