File size: 566 Bytes
03715b2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
from transformers import pipeline

MODEL_ID = "Dikshan1234/RoastBot"

generator = pipeline(
    "text-generation",
    model=MODEL_ID,
    device=-1
)

def roast(text):
    out = generator(
        f"Generate a savage roast: {text}",
        max_new_tokens=200,
        temperature=0.9,
        do_sample=True
    )
    return out[0]["generated_text"]

gr.Interface(
    fn=roast,
    inputs=gr.Textbox(placeholder="Type something to roast"),
    outputs="text",
    title="🔥 RoastBot",
    description="Savage AI Roasting Machine"
).launch()