|
import gradio as gr |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from g4f import Provider, models |
|
from langchain.llms.base import LLM |
|
|
|
from langchain_g4f import G4FLLM |
|
|
|
|
|
def main(input_text): |
|
llm: LLM = G4FLLM( |
|
model=models.gpt_35_turbo, |
|
provider=Provider.GPTalk, |
|
) |
|
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 |
|
print("Question:", input_text) |
|
print() |
|
print() |
|
res = llm(input_texxt) |
|
print(res) |
|
return res |
|
|
|
iface = gr.Interface( |
|
fn=main, |
|
inputs="text", |
|
outputs=gr.Textbox(label="Réponse"), |
|
title="bot", |
|
description="By Isa Ibn Maryam. 😂😂 Vas dormir ! Espace fermé ! ") |
|
|
|
iface.launch() |
|
|