okl
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
|
| 3 |
#
|
| 4 |
#
|
| 5 |
# supporte args
|
|
@@ -17,7 +17,7 @@ from langchain_g4f import G4FLLM
|
|
| 17 |
def main(input_text):
|
| 18 |
llm: LLM = G4FLLM(
|
| 19 |
model=models.gpt_35_turbo,
|
| 20 |
-
provider=Provider.
|
| 21 |
)
|
| 22 |
input_texxt ="Tu es un assistant intelligent.ton but est d'assiter au mieux que tu peux. tu as ete creer par le docteur Traoré et tu t'appelles Mariam." + input_text
|
| 23 |
print("Question:", input_text)
|
|
@@ -27,30 +27,6 @@ def main(input_text):
|
|
| 27 |
print(res) # Hello! How can I assist you today?
|
| 28 |
return res
|
| 29 |
|
| 30 |
-
def chatbot_interaction(input_text):
|
| 31 |
-
input_texxt ="Tu es un assistant intelligent.ton but est d'assiter au mieux que tu peux. tu as ete creer par le docteur Traoré et tu t'appelles Mariam." + input_text
|
| 32 |
-
print("Question:", input_text)
|
| 33 |
-
response = g4f.ChatCompletion.create(
|
| 34 |
-
model="gpt-3.5-turbo",
|
| 35 |
-
provider=g4f.Provider.ChatgptAi,
|
| 36 |
-
messages=[{"role": "user", "content": input_texxt}],
|
| 37 |
-
stream=False,
|
| 38 |
-
)
|
| 39 |
-
print()
|
| 40 |
-
print()
|
| 41 |
-
print()
|
| 42 |
-
print("réponse")
|
| 43 |
-
print()
|
| 44 |
-
print()
|
| 45 |
-
print()
|
| 46 |
-
|
| 47 |
-
Q = ""
|
| 48 |
-
for message in response:
|
| 49 |
-
print(message, flush=True, end='')
|
| 50 |
-
Q += message
|
| 51 |
-
print(Q)
|
| 52 |
-
|
| 53 |
-
return Q
|
| 54 |
iface = gr.Interface(
|
| 55 |
fn=main,
|
| 56 |
inputs="text",
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
|
| 3 |
#
|
| 4 |
#
|
| 5 |
# supporte args
|
|
|
|
| 17 |
def main(input_text):
|
| 18 |
llm: LLM = G4FLLM(
|
| 19 |
model=models.gpt_35_turbo,
|
| 20 |
+
provider=Provider.FreeGpt,
|
| 21 |
)
|
| 22 |
input_texxt ="Tu es un assistant intelligent.ton but est d'assiter au mieux que tu peux. tu as ete creer par le docteur Traoré et tu t'appelles Mariam." + input_text
|
| 23 |
print("Question:", input_text)
|
|
|
|
| 27 |
print(res) # Hello! How can I assist you today?
|
| 28 |
return res
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
iface = gr.Interface(
|
| 31 |
fn=main,
|
| 32 |
inputs="text",
|