transformers_js_py
from transformers_js import import_transformers_js
import gradio as gr
transformers = await import_transformers_js()
pipeline = transformers.pipeline
pipe = await pipeline('text-generation', 'Xenova/LaMini-Cerebras-590M')
async def classify(text):
return await pipe(text)
demo = gr.Interface(classify, "textbox", "json", examples=["I was walking in a nice neighborhood the other day ", "I'm an evil penguin and I", "It wasn't a bad film but"])
demo.launch()