File size: 532 Bytes
bc324c0
2695071
bc324c0
2695071
 
 
 
 
 
 
 
 
bc324c0
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import streamlit as st
from transformers import pipeline, AutoModelForSequenceClassification, AutoTokenizer

# Load your model and tokenizer from Hugging Face
model_name = "Vineedhar/Medical_papers_inference_TinyLLama"
model = AutoModelForSequenceClassification.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)

# Define the pipeline with your model
pipe = pipeline("Chatbot", model=model, tokenizer=tokenizer)

text = st.text_area("Enter some text:")

if text:
    out = pipe(text)
    st.json(out)