Mykes commited on
Commit
cf8ca80
1 Parent(s): 6258ed6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -10
app.py CHANGED
@@ -1,16 +1,28 @@
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)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
+ from ctransformers import AutoModelForCausalLM, AutoTokenizer
 
 
 
 
 
 
 
 
3
 
4
+ model = AutoModelForCausalLM.from_pretrained("Mykes/med_gemma7b_gguf", model_file="unsloth.Q4_K_M.gguf")
5
+ tokenizer = AutoTokenizer.from_pretrained(model)
6
  input_text = st.textarea('text')
7
  if text:
8
  input_ids = tokenizer(input_text, return_tensors="pt")
9
  outputs = model.generate(**input_ids)
10
+ st.write(outputs)
11
+
12
+
13
+
14
+ # from transformers import AutoTokenizer, AutoModelForCausalLM
15
+
16
+ # model_id = "Mykes/med_gemma7b_gguf"
17
+ # filename = "unsloth.Q4_K_M.gguf"
18
+
19
+ # tokenizer = AutoTokenizer.from_pretrained(model_id, gguf_file=filename)
20
+ # model = AutoModelForCausalLM.from_pretrained(model_id, gguf_file=filename)
21
+
22
+
23
+
24
+ # input_text = st.textarea('text')
25
+ # if text:
26
+ # input_ids = tokenizer(input_text, return_tensors="pt")
27
+ # outputs = model.generate(**input_ids)
28
+ # st.write(outputs)