Vineedhar's picture
Update app.py
46702b5 verified
raw
history blame
665 Bytes
import streamlit as st
from transformers import pipeline, AutoModelForSequenceClassification, AutoTokenizer
# Load your model and tokenizer from Hugging Face
model_name = "orYx-models/finetuned-tiny-llama-medical-papers"
token = "Tinyllama_secret" # Replace <your_token> with your actual Hugging Face API token
model = AutoModelForSequenceClassification.from_pretrained(model_name, token=token)
tokenizer = AutoTokenizer.from_pretrained(model_name, token=token)
# Define the pipeline with your model
pipe = pipeline("text2text-generation", model=model, tokenizer=tokenizer)
text = st.text_area("Enter some text:")
if text:
out = pipe(text)
st.json(out)