crop-yield-api / app.py
anbu-2005's picture
Update app.py
0a71cbc verified
raw
history blame contribute delete
343 Bytes
from transformers import pipeline
import gradio as gr
model = pipeline(
"text-generation",
model="anbu-2005/Dhenu2-In-Llama3.1-8B-Instruct"
)
def predict(text):
result = model(text, max_length=100)
return result[0]["generated_text"]
demo = gr.Interface(
fn=predict,
inputs="text",
outputs="text"
)
demo.launch()