Docfile commited on
Commit
3c47b1b
·
1 Parent(s): d60e17e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -1
app.py CHANGED
@@ -8,6 +8,25 @@ import g4f
8
 
9
  # streamed completion
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  def chatbot_interaction(input_text):
12
  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
13
  print("Question:", input_text)
@@ -33,7 +52,7 @@ def chatbot_interaction(input_text):
33
 
34
  return Q
35
  iface = gr.Interface(
36
- fn=chatbot_interaction,
37
  inputs="text",
38
  outputs=gr.Textbox(label="Réponse"),
39
  title="bot",
 
8
 
9
  # streamed completion
10
 
11
+ from g4f import Provider, models
12
+ from langchain.llms.base import LLM
13
+
14
+ from langchain_g4f import G4FLLM
15
+
16
+
17
+ def main(input_text):
18
+ llm: LLM = G4FLLM(
19
+ model=models.gpt_35_turbo,
20
+ provider=Provider.ChatgptAi,
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)
24
+ print()
25
+ print()
26
+ res = llm(input_texxt)
27
+ print(res) # Hello! How can I assist you today?
28
+
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)
 
52
 
53
  return Q
54
  iface = gr.Interface(
55
+ fn=main,
56
  inputs="text",
57
  outputs=gr.Textbox(label="Réponse"),
58
  title="bot",