rumed-phi3-mini / app.py
Mykes's picture
Update app.py
cf8ca80 verified
raw
history blame
874 Bytes
import streamlit as st
from ctransformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("Mykes/med_gemma7b_gguf", model_file="unsloth.Q4_K_M.gguf")
tokenizer = AutoTokenizer.from_pretrained(model)
input_text = st.textarea('text')
if text:
input_ids = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**input_ids)
st.write(outputs)
# from transformers import AutoTokenizer, AutoModelForCausalLM
# model_id = "Mykes/med_gemma7b_gguf"
# filename = "unsloth.Q4_K_M.gguf"
# tokenizer = AutoTokenizer.from_pretrained(model_id, gguf_file=filename)
# model = AutoModelForCausalLM.from_pretrained(model_id, gguf_file=filename)
# input_text = st.textarea('text')
# if text:
# input_ids = tokenizer(input_text, return_tensors="pt")
# outputs = model.generate(**input_ids)
# st.write(outputs)