Spaces:
Sleeping
Sleeping
File size: 874 Bytes
9c7e22f cf8ca80 29d374a cf8ca80 29d374a cf8ca80 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
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) |