theotherdylan commited on
Commit
7962d2c
·
1 Parent(s): a548531
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1,9 +1,10 @@
1
- import ollama
2
  import gradio
3
 
4
  history = []
5
 
6
 
 
7
  def get_history_messages():
8
  messages = []
9
  for user, assist in history:
@@ -13,13 +14,12 @@ def get_history_messages():
13
 
14
 
15
  def predict(prompt):
16
- response = ollama.chat(
17
- model="tinydolphin",
18
- messages=[
19
  *get_history_messages(),
20
  {"role": "user", "content": prompt}
21
  ],
22
- stream=True
23
  )
24
  history.append((prompt, ""))
25
  message = ""
 
1
+ from transformers import pipeline
2
  import gradio
3
 
4
  history = []
5
 
6
 
7
+
8
  def get_history_messages():
9
  messages = []
10
  for user, assist in history:
 
14
 
15
 
16
  def predict(prompt):
17
+ pipe = pipeline("text-generation", model="cognitivecomputations/TinyDolphin-2.8-1.1b")
18
+ response = pipe.generate(
19
+ [
20
  *get_history_messages(),
21
  {"role": "user", "content": prompt}
22
  ],
 
23
  )
24
  history.append((prompt, ""))
25
  message = ""