Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline, AutoModelForCausalLM | |
model = AutoModelForCausalLM.from_pretrained( | |
'vitaliy-sharandin/wiseai', | |
load_in_8bit=True, | |
device_map = {"": 0} | |
) | |
pipe = pipeline('text-generation', model=model) | |
def generate_text(prompt): | |
result = pipe(prompt, max_length=200) | |
return result[0]['generated_text'] | |
iface = gr.Interface(fn=generate_text, inputs="text", outputs="text") | |
iface.launch() |