Mykes commited on
Commit
29d374a
1 Parent(s): 218b643

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -1,4 +1,16 @@
1
  import streamlit as st
 
2
 
3
- x = st.slider('Select a value')
4
- st.write(x, 'squared is', x * x)
 
 
 
 
 
 
 
 
 
 
 
 
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)