File size: 665 Bytes
bc324c0
2695071
bc324c0
2695071
9a228a9
 
 
 
2695071
 
46702b5
2695071
 
bc324c0
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)