playground / app.py
appvoid's picture
Update app.py
19ecd3a verified
raw
history blame
568 Bytes
import os
from threading import Thread
from typing import Iterator
import gradio as gr
import spaces
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from transformers import pipeline
model = pipeline("text-generation" , model="appvoid/palmer-004")
@spaces.GPU
def predict(prompt):
completion = model(prompt)[0]["generated_text"]
return completion
gr.Interface(
fn=predict,
inputs="text",
outputs="text",
title="playground",
description=description,
examples=examples,
enable_queue=True,
).launch()