Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,16 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 3 |
|
| 4 |
+
model_id = "Mykes/med_gemma7b_gguf"
|
| 5 |
+
filename = "unsloth.Q4_K_M.gguf"
|
| 6 |
+
|
| 7 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, gguf_file=filename)
|
| 8 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, gguf_file=filename)
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
input_text = st.textarea('text')
|
| 13 |
+
if text:
|
| 14 |
+
input_ids = tokenizer(input_text, return_tensors="pt")
|
| 15 |
+
outputs = model.generate(**input_ids)
|
| 16 |
+
st.write(outputs)
|