GPT_AI / app.py
Bhaddy392's picture
Update app.py
9bb9594 verified
raw
history blame contribute delete
379 Bytes
import subprocess
import sys
subprocess.check_call([sys.executable, "-m", "pip", "install", "transformers", "torch", "gradio"])
import gradio as gr
from transformers import pipeline
pipe = pipeline("text-generation", model="sapientinc/HRM-Text-1B")
def chat(message, history):
return pipe(message, max_length=200)[0]["generated_text"]
gr.ChatInterface(fn=chat).launch()