File size: 431 Bytes
619ead2
bddad90
54dfe3d
bddad90
 
619ead2
 
bddad90
 
54dfe3d
84bb75b
54dfe3d
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import random
import gradio as gr
from transformers import pipeline


def random_response(message, history):
    return random.choice(["Yes", "No"])


generator = pipeline(model="michelebasilico/itaca-mistral-7b-v2-4bit")


def predict(message, history):
    outputs = generator(message, num_return_sequences=4,
                        return_full_text=False)

    return outputs


iface = gr.ChatInterface(predict)
iface.launch()