WiseAI / app.py
vitaliy-sharandin's picture
Update app.py
47eda2c
raw
history blame
456 Bytes
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()