Update app.py
Browse files
app.py
CHANGED
|
@@ -2,17 +2,20 @@ import gradio as gr
|
|
| 2 |
import g4f
|
| 3 |
#bQg91CNGoHslYB1gzVDII8hhg2hNFBcL15Ylvk5ThfQL9vM6LN0L09W82gLkCWd_RCw6xw
|
| 4 |
#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
|
|
|
|
| 5 |
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
def chatbot_interaction(input_text):
|
| 8 |
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
|
| 9 |
print(input_text)
|
| 10 |
response = g4f.ChatCompletion.create(
|
| 11 |
model="gpt-3.5-turbo",
|
| 12 |
-
provider=g4f.Provider.Opchatgpts,
|
| 13 |
messages=[{"role": "user", "content": input_texxt}],
|
| 14 |
stream=False,
|
| 15 |
-
|
| 16 |
print(response)
|
| 17 |
return response
|
| 18 |
iface = gr.Interface(
|
|
|
|
| 2 |
import g4f
|
| 3 |
#bQg91CNGoHslYB1gzVDII8hhg2hNFBcL15Ylvk5ThfQL9vM6LN0L09W82gLkCWd_RCw6xw
|
| 4 |
#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
|
| 5 |
+
print(g4f.Provider.Opchatgpts.params) # supported args
|
| 6 |
|
| 7 |
+
# Automatic selection of provider
|
| 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(input_text)
|
| 14 |
response = g4f.ChatCompletion.create(
|
| 15 |
model="gpt-3.5-turbo",
|
|
|
|
| 16 |
messages=[{"role": "user", "content": input_texxt}],
|
| 17 |
stream=False,
|
| 18 |
+
)
|
| 19 |
print(response)
|
| 20 |
return response
|
| 21 |
iface = gr.Interface(
|