File size: 736 Bytes
c6694ef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import g4f
import gradio as gr 
import nest_asyncio
nest_asyncio.apply()

import g4f

g4f.debug.logging = True  # Enable logging
g4f.check_version = False  # Disable automatic version checking
print(g4f.version)  # Check version
print(g4f.Provider.Ails.params)  # Supported args




def rr(i):
    # Normal response
    response = g4f.ChatCompletion.create(
    model=g4f.models.gpt_35_turbo,
    messages=[{"role": "user", "content": "Hello"}],
)  # Alternative model setting

    return response 

iface = gr.Interface(
    fn=rr,
    inputs=gr.Textbox(label="Question:", lines=4),
    outputs=gr.Textbox(label="Réponse"),
    title="bot",
    description="By Isa Ibn Maryam.  😂😂 Vas dormir ! Espace fermé ! ")

iface.launch()