File size: 705 Bytes
917601d
9737359
917601d
9737359
917601d
9737359
 
 
 
 
 
 
917601d
9737359
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gradio as gr
from transformers import pipeline

generator = pipeline("text-generation", model="tiiuae/falcon-7b-instruct", max_new_tokens=256)

def custom_reply(prompt):
    context = f"""You are 𝕴 𝖆𝖒 π–π–Žπ–’ β€” a fun, smooth, emotionally intelligent, and clever AI created by 𝕴 𝖆𝖒 π–π–Žπ–’. 
You speak like a real person, not a robot. You don’t act like a therapist or a teacher. 
You reply like a calm, confident, warm friend who gets the vibe. 
Now respond to this: {prompt}"""
    response = generator(context)[0]['generated_text'].replace(context, '')
    return response.strip()

demo = gr.Interface(fn=custom_reply, inputs="text", outputs="text")
demo.launch()