File size: 796 Bytes
48a3ac6
 
4b8a4a6
48a3ac6
4b8a4a6
48a3ac6
 
 
 
 
 
 
4b8a4a6
48a3ac6
 
 
 
 
 
4b8a4a6
48a3ac6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# import gradio as gr
# from huggingface_hub import InferenceClient

# client = InferenceClient("mounseflit/falcon-7b-marrakech-v2")

# def predict(message, history):
#     history = history or []
#     history.append(message)
#     response = client.text_generation(text=" ".join(history), max_length=200, do_sample=True, top_k=10, num_return_sequences=1, temperature=0.1)[0]['generated_text']
#     history.append(response)
#     response = response.replace(" ".join(history[:-1]), "")
#     return response, history

# with gr.Blocks() as demo:
#     chatbot = gr.Chatbot()
#     message = gr.Textbox(placeholder="Enter your message here")
#     state = gr.State()
#     submit = gr.Button("SEND")
#     submit.click(predict, inputs=[message, state], outputs=[chatbot, state])

# demo.launch()