fakeaitext / app.py
aigorithm's picture
hello
cdb0d14 verified
raw
history blame
455 Bytes
import gradio as gr
from transformers import pipeline
chatbot = pipeline("text-generation", model="mistralai/Mistral-7B-Instruct-v0.2")
def generate_chat(prompt):
response = chatbot(f"Create a fake chat conversation based on this prompt: {prompt}", max_new_tokens=300)
return response[0]["generated_text"]
iface = gr.Interface(fn=generate_chat, inputs="text", outputs="text", title="Fake Chat AI")
if __name__ == "__main__":
iface.launch()