Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,9 @@ import os
|
|
5 |
import math as matha
|
6 |
|
7 |
openai.api_key = os.environ.get("key")
|
|
|
|
|
|
|
8 |
|
9 |
title = "Mariam 💎"
|
10 |
description = """" Banana Banana ? 👀 bon ok ok. Bref comme vous le voyez c'est simple ! Pas besoin d'explication. C'est un script simple, c'est basé sur néoX, python, et gradio.
|
@@ -127,15 +130,11 @@ def gpt(prompt):
|
|
127 |
résout ce problèmes:
|
128 |
{prompt}. """
|
129 |
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
max_tokens=3500,
|
135 |
-
top_p=1,
|
136 |
-
)
|
137 |
|
138 |
-
answer = response.choices[0].text.strip()
|
139 |
print(answer)
|
140 |
return answer
|
141 |
def gpt_francais(french_prompt,choix):
|
@@ -143,14 +142,12 @@ def gpt_francais(french_prompt,choix):
|
|
143 |
if not french_prompt:
|
144 |
return "Veuillez saisir un thème ."
|
145 |
fi_prompt = f"""Je veux faire mon travail de français de niveau lycé sous la forme d'un travail argumentatif . La question du travail est la suivante: "{french_prompt}". tu devras {choix} ce thème. jai besoin dune introduction(avec une problématique et l'annonce du plan), de 3 arguments(avec explication et example et illustration) et d'une conclusion avec une ouverture(donné sous forme de phrase interogative ) """
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
)
|
153 |
-
answer = response.choices[0].text.strip()
|
154 |
print(answer)
|
155 |
return answer
|
156 |
|
@@ -182,10 +179,11 @@ CONCLUSION
|
|
182 |
-Résumer les grandes parties de la réflexion
|
183 |
2. Prise de position"""
|
184 |
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
|
|
189 |
print(answer)
|
190 |
return answer
|
191 |
|
@@ -210,14 +208,11 @@ CONCLUSION
|
|
210 |
1. Bilan de la réflexion.
|
211 |
2. question douverture du sujet.
|
212 |
"""
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
top_p=1,
|
219 |
-
)
|
220 |
-
answer = response.choices[0].text.strip()
|
221 |
print(answer)
|
222 |
return answer
|
223 |
|
@@ -338,4 +333,4 @@ demo = gr.TabbedInterface(
|
|
338 |
["OCR", "MARIAM-u", "Mariam-French", "Mariam-Philo","Mariam-Hist", "Note Calc"],
|
339 |
)
|
340 |
|
341 |
-
demo.launch(
|
|
|
5 |
import math as matha
|
6 |
|
7 |
openai.api_key = os.environ.get("key")
|
8 |
+
from gradio_client import Client
|
9 |
+
|
10 |
+
client = Client("https://docfile-bhh.hf.space/")
|
11 |
|
12 |
title = "Mariam 💎"
|
13 |
description = """" Banana Banana ? 👀 bon ok ok. Bref comme vous le voyez c'est simple ! Pas besoin d'explication. C'est un script simple, c'est basé sur néoX, python, et gradio.
|
|
|
130 |
résout ce problèmes:
|
131 |
{prompt}. """
|
132 |
|
133 |
+
answer = client.predict(
|
134 |
+
f_prompt, # str in 'input_text' Textbox component
|
135 |
+
api_name="/predict"
|
136 |
+
)
|
|
|
|
|
|
|
137 |
|
|
|
138 |
print(answer)
|
139 |
return answer
|
140 |
def gpt_francais(french_prompt,choix):
|
|
|
142 |
if not french_prompt:
|
143 |
return "Veuillez saisir un thème ."
|
144 |
fi_prompt = f"""Je veux faire mon travail de français de niveau lycé sous la forme d'un travail argumentatif . La question du travail est la suivante: "{french_prompt}". tu devras {choix} ce thème. jai besoin dune introduction(avec une problématique et l'annonce du plan), de 3 arguments(avec explication et example et illustration) et d'une conclusion avec une ouverture(donné sous forme de phrase interogative ) """
|
145 |
+
|
146 |
+
answer = client.predict(
|
147 |
+
fi_prompt, # str in 'input_text' Textbox component
|
148 |
+
api_name="/predict"
|
149 |
+
)
|
150 |
+
|
|
|
|
|
151 |
print(answer)
|
152 |
return answer
|
153 |
|
|
|
179 |
-Résumer les grandes parties de la réflexion
|
180 |
2. Prise de position"""
|
181 |
|
182 |
+
answer = client.predict(
|
183 |
+
haha, # str in 'input_text' Textbox component
|
184 |
+
api_name="/predict"
|
185 |
+
)
|
186 |
+
|
187 |
print(answer)
|
188 |
return answer
|
189 |
|
|
|
208 |
1. Bilan de la réflexion.
|
209 |
2. question douverture du sujet.
|
210 |
"""
|
211 |
+
answer = client.predict(
|
212 |
+
histt_prompt, # str in 'input_text' Textbox component
|
213 |
+
api_name="/predict"
|
214 |
+
)
|
215 |
+
|
|
|
|
|
|
|
216 |
print(answer)
|
217 |
return answer
|
218 |
|
|
|
333 |
["OCR", "MARIAM-u", "Mariam-French", "Mariam-Philo","Mariam-Hist", "Note Calc"],
|
334 |
)
|
335 |
|
336 |
+
demo.launch()
|